change(deps): Upgrade to the zcash_primitives 0.10 API (#6087)

* bump zcash_primitives and proofs to 0.10.0

* Update to latest Sapling API

* Update Cargo.lock
This commit is contained in:
teor 2023-02-07 01:23:13 +10:00 committed by GitHub
parent c4032e2b7f
commit 8c0176fca5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 23 additions and 13 deletions

12
Cargo.lock generated
View File

@ -5359,9 +5359,9 @@ dependencies = [
[[package]]
name = "zcash_primitives"
version = "0.9.1"
version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0f9a45953c4ddd81d68f45920955707f45c8926800671f354dd13b97507edf28"
checksum = "b6879bd4026d9269a41ca91858f453b523f30824288248148211e1cab23b3e0d"
dependencies = [
"aes",
"bip0039",
@ -5395,9 +5395,9 @@ dependencies = [
[[package]]
name = "zcash_proofs"
version = "0.9.0"
version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "77381adc72286874e563ee36ba99953946abcbd195ada45440a2754ca823d407"
checksum = "28ca180a8138ae6e2de2b88573ed19dd57798f42a79a00d992b4d727132c7081"
dependencies = [
"bellman",
"blake2b_simd",
@ -5410,7 +5410,7 @@ dependencies = [
"rand_core 0.6.4",
"redjubjub",
"tracing",
"zcash_primitives 0.9.1",
"zcash_primitives 0.10.0",
]
[[package]]
@ -5492,7 +5492,7 @@ dependencies = [
"zcash_encoding",
"zcash_history",
"zcash_note_encryption",
"zcash_primitives 0.9.1",
"zcash_primitives 0.10.0",
"zebra-test",
]

View File

@ -63,7 +63,7 @@ orchard = "0.3.0"
zcash_encoding = "0.2.0"
zcash_history = "0.3.0"
zcash_note_encryption = "0.2.0"
zcash_primitives = { version = "0.9.1", features = ["transparent-inputs"] }
zcash_primitives = { version = "0.10.0", features = ["transparent-inputs"] }
# Time
chrono = { version = "0.4.23", default-features = false, features = ["clock", "std", "serde"] }

View File

@ -1,6 +1,6 @@
//! Contains code that interfaces with the zcash_note_encryption crate from
//! librustzcash.
//!
use crate::{
block::Height,
parameters::{Network, NetworkUpgrade},
@ -24,7 +24,7 @@ pub fn decrypts_successfully(transaction: &Transaction, network: Network, height
let null_sapling_ovk = zcash_primitives::keys::OutgoingViewingKey([0u8; 32]);
if let Some(bundle) = alt_tx.sapling_bundle() {
for output in bundle.shielded_outputs.iter() {
for output in bundle.shielded_outputs().iter() {
let recovery = match network {
Network::Mainnet => {
zcash_primitives::sapling::note_encryption::try_sapling_output_recovery(

View File

@ -13,6 +13,8 @@ use crate::{
transparent::{self, Script},
};
// TODO: move copied and modified code to a separate module.
//
// Used by boilerplate code below.
#[derive(Clone, Debug)]
@ -87,10 +89,18 @@ impl
zp_tx::components::sapling::Authorized,
> for IdentityMap
{
fn map_proof(
fn map_spend_proof(
&self,
p: <zp_tx::components::sapling::Authorized as zp_tx::components::sapling::Authorization>::Proof,
) -> <zp_tx::components::sapling::Authorized as zp_tx::components::sapling::Authorization>::Proof
p: <zp_tx::components::sapling::Authorized as zp_tx::components::sapling::Authorization>::SpendProof,
) -> <zp_tx::components::sapling::Authorized as zp_tx::components::sapling::Authorization>::SpendProof
{
p
}
fn map_output_proof(
&self,
p: <zp_tx::components::sapling::Authorized as zp_tx::components::sapling::Authorization>::OutputProof,
) -> <zp_tx::components::sapling::Authorized as zp_tx::components::sapling::Authorization>::OutputProof
{
p
}

View File

@ -47,7 +47,7 @@ tracing-futures = "0.2.5"
orchard = "0.3.0"
zcash_proofs = { version = "0.9.0", features = ["local-prover", "multicore", "download-params"] }
zcash_proofs = { version = "0.10.0", features = ["local-prover", "multicore", "download-params"] }
tower-fallback = { path = "../tower-fallback/" }
tower-batch = { path = "../tower-batch/" }