Skip to content

Commit

Permalink
Merge pull request zcash#5429 from str4d/pre-4.6.0-rc1-changes
Browse files Browse the repository at this point in the history
Pre-4.6.0-rc1 changes
  • Loading branch information
str4d authored Dec 18, 2021
2 parents eb175dd + 8387aa4 commit 75b5394
Show file tree
Hide file tree
Showing 5 changed files with 93 additions and 54 deletions.
87 changes: 54 additions & 33 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 10 additions & 12 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,25 +27,25 @@ crate-type = ["staticlib"]

[dependencies]
bellman = "0.11"
blake2b_simd = "0.5"
blake2s_simd = "0.5"
blake2b_simd = "1"
blake2s_simd = "1"
bls12_381 = "0.6"
byteorder = "1"
group = "0.11"
incrementalmerkletree = "0.1"
incrementalmerkletree = "0.2"
libc = "0.2"
jubjub = "0.8"
memuse = "0.2"
nonempty = "0.7"
orchard = "0.0"
orchard = "=0.1.0-beta.1"
subtle = "2.2"
rand_core = "0.6"
tracing = "0.1"
tracing-core = "0.1"
tracing-appender = "0.2"
zcash_address = "0.0"
zcash_history = "0.2"
zcash_note_encryption = "0.0"
zcash_note_encryption = "0.1"
zcash_primitives = "0.5"
zcash_proofs = "0.5"
ed25519-zebra = "3"
Expand All @@ -69,10 +69,8 @@ panic = 'abort'
codegen-units = 1

[patch.crates-io]
incrementalmerkletree = { git = "https://github.com/zcash/incrementalmerkletree", rev = "b7bd6246122a6e9ace8edb51553fbf5228906cbb" }
orchard = { git = "https://github.com/zcash/orchard.git", rev = "2c8241f25b943aa05203eacf9905db117c69bd29" }
zcash_address = { git = "https://github.com/zcash/librustzcash.git", rev = "53d0a51d33a421cb76d3e3124d1e4c1c9036068e" }
zcash_history = { git = "https://github.com/zcash/librustzcash.git", rev = "53d0a51d33a421cb76d3e3124d1e4c1c9036068e" }
zcash_note_encryption = { git = "https://github.com/zcash/librustzcash.git", rev = "53d0a51d33a421cb76d3e3124d1e4c1c9036068e" }
zcash_primitives = { git = "https://github.com/zcash/librustzcash.git", rev = "53d0a51d33a421cb76d3e3124d1e4c1c9036068e" }
zcash_proofs = { git = "https://github.com/zcash/librustzcash.git", rev = "53d0a51d33a421cb76d3e3124d1e4c1c9036068e" }
zcash_address = { git = "https://github.com/zcash/librustzcash.git", rev = "5622b060b1f57de7afc3d0b4e425b9b4b22482a0" }
zcash_history = { git = "https://github.com/zcash/librustzcash.git", rev = "5622b060b1f57de7afc3d0b4e425b9b4b22482a0" }
zcash_note_encryption = { git = "https://github.com/zcash/librustzcash.git", rev = "5622b060b1f57de7afc3d0b4e425b9b4b22482a0" }
zcash_primitives = { git = "https://github.com/zcash/librustzcash.git", rev = "5622b060b1f57de7afc3d0b4e425b9b4b22482a0" }
zcash_proofs = { git = "https://github.com/zcash/librustzcash.git", rev = "5622b060b1f57de7afc3d0b4e425b9b4b22482a0" }
17 changes: 17 additions & 0 deletions doc/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,23 @@ release-notes at release time)
Notable changes
===============

Wallet
------

From this release, newly-created wallets will save the chain name ("Zcash") and
network identifier (e.g. "main") to the `wallet.dat` file. This will enable the
`zcashd` node to check on subsequent starts that the `wallet.dat` file matches
the node's configuration. Existing wallets will start saving this information in
a later release.

`libzcash_script`
-----------------

Two new APIs have been added to this library (`zcash_script_legacy_sigop_count`
and `zcash_script_legacy_sigop_count_precomputed`), for counting the number of
signature operations in the transparent inputs and outputs of a transaction.
The presence of these APIs is indicated by a library API version of 2.

Updated RPCs
------------

Expand Down
15 changes: 9 additions & 6 deletions src/rust/src/address_ffi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ use std::{
};

use libc::{c_char, c_void};
use zcash_address::{unified, FromAddress, Network, ToAddress, ZcashAddress};
use zcash_address::{
unified::{self, Container, Encoding},
FromAddress, Network, ToAddress, ZcashAddress,
};
use zcash_primitives::sapling;

pub type UnifiedAddressObj = NonNull<c_void>;
Expand Down Expand Up @@ -69,8 +72,8 @@ impl UnifiedAddressHelper {
}

self.ua
.receivers()
.into_iter()
.items_as_parsed()
.iter()
.map(|receiver| match receiver {
unified::Receiver::Orchard(data) => {
// ZIP 316: Senders MUST reject Unified Addresses in which any
Expand All @@ -92,7 +95,7 @@ impl UnifiedAddressHelper {
// ZIP 316: Senders MUST reject Unified Addresses in which any
// constituent address does not meet the validation requirements of
// its Receiver Encoding.
if sapling::PaymentAddress::from_bytes(&data).is_none() {
if sapling::PaymentAddress::from_bytes(data).is_none() {
tracing::error!("Unified Address contains invalid Sapling receiver");
false
} else {
Expand All @@ -106,7 +109,7 @@ impl UnifiedAddressHelper {
(p2pkh_cb.unwrap())(ua_obj, data.as_ptr())
},
unified::Receiver::Unknown { typecode, data } => unsafe {
(unknown_cb.unwrap())(ua_obj, typecode, data.as_ptr(), data.len())
(unknown_cb.unwrap())(ua_obj, *typecode, data.as_ptr(), data.len())
},
})
.all(|b| b)
Expand Down Expand Up @@ -209,7 +212,7 @@ pub extern "C" fn zcash_address_serialize_unified(
}
};

let ua: unified::Address = match receivers.try_into() {
let ua = match unified::Address::try_from_items_preserving_order(receivers) {
Ok(ua) => ua,
Err(e) => {
tracing::error!("{}", e);
Expand Down
6 changes: 3 additions & 3 deletions src/rust/src/rustzcash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1089,9 +1089,9 @@ pub extern "C" fn librustzcash_zip32_xfvk_address(
.expect("valid ExtendedFullViewingKey");
let j = zip32::DiversifierIndex(unsafe { *j });

let addr = match xfvk.address(j) {
Ok(addr) => addr,
Err(_) => return false,
let addr = match xfvk.find_address(j) {
Some(addr) => addr,
None => return false,
};

let j_ret = unsafe { &mut *j_ret };
Expand Down

0 comments on commit 75b5394

Please sign in to comment.