Automatically load and save wallet

This commit is contained in:
Aditya Kulkarni
2019-09-06 14:09:12 -07:00
parent c2e26fbbca
commit 48d305c406
4 changed files with 59 additions and 30 deletions

View File

@@ -1,22 +1,22 @@
pub extern crate ff;
use std::time::SystemTime;
use std::io::{self, Read, Write};
use byteorder::{LittleEndian, ReadBytesExt, WriteBytesExt};
use pairing::bls12_381::{Bls12};
use zcash_primitives::primitives::{Diversifier, Note, PaymentAddress, /*read_note */ };
use std::cmp;
use std::collections::HashMap;
use std::sync::{Arc, RwLock};
use protobuf::*;
use byteorder::{LittleEndian, ReadBytesExt, WriteBytesExt};
use pairing::bls12_381::{Bls12};
use ff::{PrimeField, PrimeFieldRepr};
use zcash_client_backend::{
constants::testnet::HRP_SAPLING_PAYMENT_ADDRESS, encoding::encode_payment_address,
proto::compact_formats::CompactBlock, welding_rig::scan_block,
};
use ff::{PrimeField, PrimeFieldRepr};
use zcash_primitives::{
block::BlockHash,
merkle_tree::{CommitmentTree, IncrementalWitness},
@@ -30,21 +30,16 @@ use zcash_primitives::{
note_encryption::{Memo, try_sapling_note_decryption},
zip32::{ExtendedFullViewingKey, ExtendedSpendingKey},
JUBJUB,
};
use zcash_primitives::jubjub::{
JubjubEngine,
fs::{Fs, FsRepr},
primitives::{Diversifier, Note, PaymentAddress},
jubjub::{
JubjubEngine,
fs::{Fs, FsRepr},
}
};
use crate::address;
use crate::prover;
// When the `wee_alloc` feature is enabled, use `wee_alloc` as the global
// allocator.
#[cfg(feature = "wee_alloc")]
#[global_allocator]
static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT;
const ANCHOR_OFFSET: u32 = 10;
const SAPLING_ACTIVATION_HEIGHT: i32 = 280_000;