From f0cf40543a92cd98829b2a6c8462b2f0d0e6da46 Mon Sep 17 00:00:00 2001 From: Daira-Emma Hopwood Date: Wed, 19 Jun 2024 16:36:37 +0100 Subject: [PATCH] Update tests in testing/pool.rs to use ZIP 317 fees. Signed-off-by: Daira-Emma Hopwood --- zcash_client_sqlite/src/testing/pool.rs | 34 ++++++------------------- 1 file changed, 8 insertions(+), 26 deletions(-) diff --git a/zcash_client_sqlite/src/testing/pool.rs b/zcash_client_sqlite/src/testing/pool.rs index 44b463fab..833eb52b0 100644 --- a/zcash_client_sqlite/src/testing/pool.rs +++ b/zcash_client_sqlite/src/testing/pool.rs @@ -180,10 +180,7 @@ pub(crate) fn send_single_step_proposed_transfer() { )]) .unwrap(); - // TODO: This test was originally written to use the pre-zip-313 fee rule - // and has not yet been updated. - #[allow(deprecated)] - let fee_rule = StandardFeeRule::PreZip313; + let fee_rule = StandardFeeRule::Zip317; let change_memo = "Test change memo".parse::().unwrap(); let change_strategy = standard::SingleOutputChangeStrategy::new( @@ -686,10 +683,7 @@ pub(crate) fn spend_fails_on_locked_notes() { let account_id = account.account_id(); let dfvk = T::test_account_fvk(&st); - // TODO: This test was originally written to use the pre-zip-313 fee rule - // and has not yet been updated. - #[allow(deprecated)] - let fee_rule = StandardFeeRule::PreZip313; + let fee_rule = StandardFeeRule::Zip317; // Add funds to the wallet in a single note let value = NonNegativeAmount::const_from_u64(50000); @@ -836,10 +830,7 @@ pub(crate) fn ovk_policy_prevents_recovery_from_chain() { let extsk2 = T::sk(&[0xf5; 32]); let addr2 = T::sk_default_address(&extsk2); - // TODO: This test was originally written to use the pre-zip-313 fee rule - // and has not yet been updated. - #[allow(deprecated)] - let fee_rule = StandardFeeRule::PreZip313; + let fee_rule = StandardFeeRule::Zip317; #[allow(clippy::type_complexity)] let send_and_recover_with_policy = |st: &mut TestState, @@ -921,7 +912,7 @@ pub(crate) fn spend_succeeds_to_t_addr_zero_change() { let dfvk = T::test_account_fvk(&st); // Add funds to the wallet in a single note - let value = NonNegativeAmount::const_from_u64(60000); + let value = NonNegativeAmount::const_from_u64(70000); let (h, _, _) = st.generate_next_block(&dfvk, AddressType::DefaultExternal, value); st.scan_cached_blocks(h, 1); @@ -929,10 +920,7 @@ pub(crate) fn spend_succeeds_to_t_addr_zero_change() { assert_eq!(st.get_total_balance(account_id), value); assert_eq!(st.get_spendable_balance(account_id, 1), value); - // TODO: This test was originally written to use the pre-zip-313 fee rule - // and has not yet been updated. - #[allow(deprecated)] - let fee_rule = StandardFeeRule::PreZip313; + let fee_rule = StandardFeeRule::Zip317; // TODO: generate_next_block_from_tx does not currently support transparent outputs. let to = TransparentAddress::PublicKeyHash([7; 20]).into(); @@ -968,7 +956,7 @@ pub(crate) fn change_note_spends_succeed() { let dfvk = T::test_account_fvk(&st); // Add funds to the wallet in a single note owned by the internal spending key - let value = NonNegativeAmount::const_from_u64(60000); + let value = NonNegativeAmount::const_from_u64(70000); let (h, _, _) = st.generate_next_block(&dfvk, AddressType::Internal, value); st.scan_cached_blocks(h, 1); @@ -995,10 +983,7 @@ pub(crate) fn change_note_spends_succeed() { ); assert_matches!(change_note_scope, Ok(Some(Scope::Internal))); - // TODO: This test was originally written to use the pre-zip-313 fee rule - // and has not yet been updated. - #[allow(deprecated)] - let fee_rule = StandardFeeRule::PreZip313; + let fee_rule = StandardFeeRule::Zip317; // TODO: generate_next_block_from_tx does not currently support transparent outputs. let to = TransparentAddress::PublicKeyHash([7; 20]).into(); @@ -1235,10 +1220,7 @@ pub(crate) fn shield_transparent() { let res0 = st.wallet_mut().put_received_transparent_utxo(&utxo); assert_matches!(res0, Ok(_)); - // TODO: This test was originally written to use the pre-zip-313 fee rule - // and has not yet been updated. - #[allow(deprecated)] - let fee_rule = StandardFeeRule::PreZip313; + let fee_rule = StandardFeeRule::Zip317; let input_selector = GreedyInputSelector::new( standard::SingleOutputChangeStrategy::new(fee_rule, None, T::SHIELDED_PROTOCOL),