update librustzcash, change zcash_history to work with it

This commit is contained in:
Conrado P. L. Gouvea 2021-06-17 10:22:03 -03:00 committed by Deirdre Connolly
parent e7010adbe1
commit 1cb10ec9e7
2 changed files with 5 additions and 5 deletions

2
Cargo.lock generated
View File

@ -4414,7 +4414,7 @@ dependencies = [
[[package]] [[package]]
name = "zcash_history" name = "zcash_history"
version = "0.2.0" version = "0.2.0"
source = "git+https://github.com/zcash/librustzcash.git#d88e40113c8dadea751dfcdd72ee90868f9655ff" source = "git+https://github.com/zcash/librustzcash.git#0c3ed159985affa774e44d10172d4471d798a85a"
dependencies = [ dependencies = [
"bigint", "bigint",
"blake2b_simd", "blake2b_simd",

View File

@ -21,7 +21,7 @@ use crate::{
pub struct Tree { pub struct Tree {
network: Network, network: Network,
network_upgrade: NetworkUpgrade, network_upgrade: NetworkUpgrade,
inner: zcash_history::Tree, inner: zcash_history::Tree<zcash_history::V1>,
} }
/// An encoded tree node data. /// An encoded tree node data.
@ -48,9 +48,9 @@ pub struct Entry {
inner: [u8; zcash_history::MAX_ENTRY_SIZE], inner: [u8; zcash_history::MAX_ENTRY_SIZE],
} }
impl From<zcash_history::Entry> for Entry { impl From<zcash_history::Entry<zcash_history::V1>> for Entry {
/// Convert from librustzcash. /// Convert from librustzcash.
fn from(inner_entry: zcash_history::Entry) -> Self { fn from(inner_entry: zcash_history::Entry<zcash_history::V1>) -> Self {
let mut entry = Entry { let mut entry = Entry {
inner: [0; zcash_history::MAX_ENTRY_SIZE], inner: [0; zcash_history::MAX_ENTRY_SIZE],
}; };
@ -66,7 +66,7 @@ impl Entry {
/// Sapling note commitment tree. /// Sapling note commitment tree.
fn new_leaf(block: Arc<Block>, network: Network, sapling_root: &sapling::tree::Root) -> Self { fn new_leaf(block: Arc<Block>, network: Network, sapling_root: &sapling::tree::Root) -> Self {
let node_data = block_to_history_node(block, network, sapling_root); let node_data = block_to_history_node(block, network, sapling_root);
let inner_entry: zcash_history::Entry = node_data.into(); let inner_entry = zcash_history::Entry::<zcash_history::V1>::new_leaf(node_data);
inner_entry.into() inner_entry.into()
} }