diff --git a/zcash_client_backend/CHANGELOG.md b/zcash_client_backend/CHANGELOG.md index 435ce781d..b2afb2d8f 100644 --- a/zcash_client_backend/CHANGELOG.md +++ b/zcash_client_backend/CHANGELOG.md @@ -12,7 +12,7 @@ and this library adheres to Rust's notion of - `AccountSource::key_derivation` - `error::PcztError` - `wallet::ExtractErrT` - - `wallet::create_proposed_transaction_pczt` + - `wallet::create_pczt_from_proposal` - `wallet::extract_and_store_transaction_from_pczt` ### Changed diff --git a/zcash_client_backend/Cargo.toml b/zcash_client_backend/Cargo.toml index 30e4fe1c1..ceb7defd4 100644 --- a/zcash_client_backend/Cargo.toml +++ b/zcash_client_backend/Cargo.toml @@ -172,7 +172,7 @@ transparent-inputs = [ ## Enables receiving and spending Orchard funds. orchard = ["dep:orchard", "dep:pasta_curves", "zcash_keys/orchard"] -## Enables creating partially-signed transactions for use in hardware wallet and multisig scenarios. +## Enables creating partially-constructed transactions for use in hardware wallet and multisig scenarios. pczt = [ "orchard", "transparent-inputs", diff --git a/zcash_client_backend/src/data_api/error.rs b/zcash_client_backend/src/data_api/error.rs index 3ba536c86..e5a26a9a4 100644 --- a/zcash_client_backend/src/data_api/error.rs +++ b/zcash_client_backend/src/data_api/error.rs @@ -86,8 +86,8 @@ pub enum Error), - /// A proposed transaction cannot be built because it requires spending an input of a type for - /// which a key that is required to construct the transaciton is not available. + /// A proposed transaction cannot be built because it requires spending an input of + /// a type for which a key required to construct the transaction is not available. KeyNotAvailable(PoolType), /// A note being spent does not correspond to either the internal or external diff --git a/zcash_client_backend/src/data_api/testing.rs b/zcash_client_backend/src/data_api/testing.rs index 8643098ce..4eb469994 100644 --- a/zcash_client_backend/src/data_api/testing.rs +++ b/zcash_client_backend/src/data_api/testing.rs @@ -1092,12 +1092,12 @@ where ) } - /// Invokes [`create_proposed_transaction_pczt`] with the given arguments. + /// Invokes [`create_pczt_from_proposal`] with the given arguments. /// - /// [`create_proposed_transaction_pczt`]: super::wallet::create_proposed_transaction_pczt + /// [`create_pczt_from_proposal`]: super::wallet::create_pczt_from_proposal #[cfg(feature = "pczt")] #[allow(clippy::type_complexity)] - pub fn create_proposed_transaction_pczt( + pub fn create_pczt_from_proposal( &mut self, spend_from_account: ::AccountId, ovk_policy: OvkPolicy, @@ -1110,11 +1110,11 @@ where ::AccountId: serde::Serialize, FeeRuleT: FeeRule, { - use super::wallet::create_proposed_transaction_pczt; + use super::wallet::create_pczt_from_proposal; let network = self.network().clone(); - create_proposed_transaction_pczt( + create_pczt_from_proposal( self.wallet_mut(), &network, spend_from_account, diff --git a/zcash_client_backend/src/data_api/testing/pool.rs b/zcash_client_backend/src/data_api/testing/pool.rs index a9f055d1c..0cacac946 100644 --- a/zcash_client_backend/src/data_api/testing/pool.rs +++ b/zcash_client_backend/src/data_api/testing/pool.rs @@ -3111,8 +3111,10 @@ pub fn pczt_single_step( .with_block_cache(cache) .with_initial_chain_state(|_, network| { // Initialize the chain state to after ZIP 212 became enforced. - let birthday_height = - network.activation_height(NetworkUpgrade::Nu5).unwrap() + ZIP212_GRACE_PERIOD; + let birthday_height = std::cmp::max( + network.activation_height(NetworkUpgrade::Nu5).unwrap(), + network.activation_height(NetworkUpgrade::Canopy).unwrap() + ZIP212_GRACE_PERIOD, + ); InitialChainState { chain_state: ChainState::new( @@ -3168,7 +3170,7 @@ pub fn pczt_single_step( let _min_target_height = proposal0.min_target_height(); assert_eq!(proposal0.steps().len(), 1); - let create_proposed_result = st.create_proposed_transaction_pczt::( + let create_proposed_result = st.create_pczt_from_proposal::( account.id(), OvkPolicy::Sender, &proposal0, diff --git a/zcash_client_backend/src/data_api/wallet.rs b/zcash_client_backend/src/data_api/wallet.rs index fff664745..8d19e3189 100644 --- a/zcash_client_backend/src/data_api/wallet.rs +++ b/zcash_client_backend/src/data_api/wallet.rs @@ -1329,7 +1329,7 @@ where #[allow(clippy::too_many_arguments)] #[allow(clippy::type_complexity)] #[cfg(feature = "pczt")] -pub fn create_proposed_transaction_pczt( +pub fn create_pczt_from_proposal( wallet_db: &mut DbT, params: &ParamsT, account_id: ::AccountId, @@ -1592,7 +1592,7 @@ where /// Finalizes the given PCZT, and persists the transaction to the wallet database. /// -/// The PCZT should have been created via [`create_proposed_transaction_pczt`], which adds +/// The PCZT should have been created via [`create_pczt_from_proposal`], which adds /// metadata necessary for the wallet backend. /// /// Returns the transaction ID for the resulting transaction.