From 1cb10ec9e7c8375a6f25487ece62b156335d2ad5 Mon Sep 17 00:00:00 2001 From: "Conrado P. L. Gouvea" Date: Thu, 17 Jun 2021 10:22:03 -0300 Subject: [PATCH] update librustzcash, change zcash_history to work with it --- Cargo.lock | 2 +- zebra-chain/src/primitives/zcash_history.rs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 702f4694..afb97897 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4414,7 +4414,7 @@ dependencies = [ [[package]] name = "zcash_history" version = "0.2.0" -source = "git+https://github.com/zcash/librustzcash.git#d88e40113c8dadea751dfcdd72ee90868f9655ff" +source = "git+https://github.com/zcash/librustzcash.git#0c3ed159985affa774e44d10172d4471d798a85a" dependencies = [ "bigint", "blake2b_simd", diff --git a/zebra-chain/src/primitives/zcash_history.rs b/zebra-chain/src/primitives/zcash_history.rs index 5ccfdad0..1c96ab47 100644 --- a/zebra-chain/src/primitives/zcash_history.rs +++ b/zebra-chain/src/primitives/zcash_history.rs @@ -21,7 +21,7 @@ use crate::{ pub struct Tree { network: Network, network_upgrade: NetworkUpgrade, - inner: zcash_history::Tree, + inner: zcash_history::Tree, } /// An encoded tree node data. @@ -48,9 +48,9 @@ pub struct Entry { inner: [u8; zcash_history::MAX_ENTRY_SIZE], } -impl From for Entry { +impl From> for Entry { /// Convert from librustzcash. - fn from(inner_entry: zcash_history::Entry) -> Self { + fn from(inner_entry: zcash_history::Entry) -> Self { let mut entry = Entry { inner: [0; zcash_history::MAX_ENTRY_SIZE], }; @@ -66,7 +66,7 @@ impl Entry { /// Sapling note commitment tree. fn new_leaf(block: Arc, network: Network, sapling_root: &sapling::tree::Root) -> Self { 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::::new_leaf(node_data); inner_entry.into() }