diff --git a/zcash_client_backend/src/fees/fixed.rs b/zcash_client_backend/src/fees/fixed.rs index d57953399..eea1f1602 100644 --- a/zcash_client_backend/src/fees/fixed.rs +++ b/zcash_client_backend/src/fees/fixed.rs @@ -185,7 +185,7 @@ mod tests { &Vec::::new(), &[TestSaplingInput { note_id: 0, - value: Amount::from_u64(45000).unwrap(), + value: Amount::from_u64(60000).unwrap(), }], &[SaplingPayment::new(Amount::from_u64(40000).unwrap())], &DustOutputPolicy::default(), @@ -193,8 +193,8 @@ mod tests { assert_matches!( result, - Ok(balance) if balance.proposed_change() == [ChangeValue::Sapling(Amount::from_u64(4000).unwrap())] - && balance.fee_required() == Amount::from_u64(1000).unwrap() + Ok(balance) if balance.proposed_change() == [ChangeValue::Sapling(Amount::from_u64(10000).unwrap())] + && balance.fee_required() == Amount::from_u64(10000).unwrap() ); } @@ -218,7 +218,7 @@ mod tests { // enough to pay a fee, plus dust TestSaplingInput { note_id: 0, - value: Amount::from_u64(1100).unwrap(), + value: Amount::from_u64(10100).unwrap(), }, ], &[SaplingPayment::new(Amount::from_u64(40000).unwrap())], @@ -228,7 +228,7 @@ mod tests { assert_matches!( result, Err(ChangeError::InsufficientFunds { available, required }) - if available == Amount::from_u64(41100).unwrap() && required == Amount::from_u64(42000).unwrap() + if available == Amount::from_u64(50100).unwrap() && required == Amount::from_u64(60000).unwrap() ); } } diff --git a/zcash_client_sqlite/src/wallet/transact.rs b/zcash_client_sqlite/src/wallet/transact.rs index 3e2754dc5..392b8f483 100644 --- a/zcash_client_sqlite/src/wallet/transact.rs +++ b/zcash_client_sqlite/src/wallet/transact.rs @@ -354,7 +354,7 @@ mod tests { available, required }) - if available == Amount::zero() && required == Amount::from_u64(1001).unwrap() + if available == Amount::zero() && required == Amount::from_u64(10001).unwrap() ); } @@ -437,7 +437,7 @@ mod tests { required }) if available == Amount::from_u64(50000).unwrap() - && required == Amount::from_u64(71000).unwrap() + && required == Amount::from_u64(80000).unwrap() ); // Mine blocks SAPLING_ACTIVATION_HEIGHT + 2 to 9 until just before the second @@ -472,7 +472,7 @@ mod tests { required }) if available == Amount::from_u64(50000).unwrap() - && required == Amount::from_u64(71000).unwrap() + && required == Amount::from_u64(80000).unwrap() ); // Mine block 11 so that the second note becomes verified @@ -568,7 +568,7 @@ mod tests { available, required }) - if available == Amount::zero() && required == Amount::from_u64(3000).unwrap() + if available == Amount::zero() && required == Amount::from_u64(12000).unwrap() ); // Mine blocks SAPLING_ACTIVATION_HEIGHT + 1 to 21 (that don't send us funds) @@ -602,7 +602,7 @@ mod tests { available, required }) - if available == Amount::zero() && required == Amount::from_u64(3000).unwrap() + if available == Amount::zero() && required == Amount::from_u64(12000).unwrap() ); // Mine block SAPLING_ACTIVATION_HEIGHT + 22 so that the first transaction expires @@ -752,7 +752,7 @@ mod tests { let dfvk = usk.sapling().to_diversifiable_full_viewing_key(); // Add funds to the wallet in a single note - let value = Amount::from_u64(51000).unwrap(); + let value = Amount::from_u64(60000).unwrap(); let (cb, _) = fake_compact_block( sapling_activation_height(), BlockHash([0; 32]), @@ -806,7 +806,7 @@ mod tests { let dfvk = usk.sapling().to_diversifiable_full_viewing_key(); // Add funds to the wallet in a single note - let value = Amount::from_u64(51000).unwrap(); + let value = Amount::from_u64(60000).unwrap(); let (cb, _) = fake_compact_block( sapling_activation_height(), BlockHash([0; 32]), diff --git a/zcash_extensions/src/transparent/demo.rs b/zcash_extensions/src/transparent/demo.rs index a8d3a7781..a06bffb66 100644 --- a/zcash_extensions/src/transparent/demo.rs +++ b/zcash_extensions/src/transparent/demo.rs @@ -814,7 +814,7 @@ mod tests { // create some inputs to spend let extsk = ExtendedSpendingKey::master(&[]); let to = extsk.default_address().1; - let note1 = to.create_note(101000, Rseed::BeforeZip212(jubjub::Fr::random(&mut rng))); + let note1 = to.create_note(110000, Rseed::BeforeZip212(jubjub::Fr::random(&mut rng))); let cm1 = Node::from_cmu(¬e1.cmu()); let mut tree = CommitmentTree::empty(); // fake that the note appears in some previous diff --git a/zcash_primitives/CHANGELOG.md b/zcash_primitives/CHANGELOG.md index a0403b3e8..22b750f91 100644 --- a/zcash_primitives/CHANGELOG.md +++ b/zcash_primitives/CHANGELOG.md @@ -6,6 +6,9 @@ and this library adheres to Rust's notion of [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Changed +- `zcash_primitives::transactions::component::amount::DEFAULT_FEE` increased zip317 + minimum possible fee. ## [0.11.0] - 2023-04-15 ### Added diff --git a/zcash_primitives/src/transaction/builder.rs b/zcash_primitives/src/transaction/builder.rs index d1930ece5..f45286999 100644 --- a/zcash_primitives/src/transaction/builder.rs +++ b/zcash_primitives/src/transaction/builder.rs @@ -653,7 +653,7 @@ mod tests { builder .add_transparent_output( &TransparentAddress::PublicKey([0; 20]), - Amount::from_u64(49000).unwrap(), + Amount::from_u64(40000).unwrap(), ) .unwrap(); @@ -689,7 +689,7 @@ mod tests { builder .add_transparent_output( &TransparentAddress::PublicKey([0; 20]), - Amount::from_u64(49000).unwrap(), + Amount::from_u64(40000).unwrap(), ) .unwrap(); @@ -778,7 +778,7 @@ mod tests { ); } - let note1 = to.create_note(50999, Rseed::BeforeZip212(jubjub::Fr::random(&mut rng))); + let note1 = to.create_note(59999, Rseed::BeforeZip212(jubjub::Fr::random(&mut rng))); let cmu1 = Node::from_cmu(¬e1.cmu()); let mut tree = CommitmentTree::empty(); tree.append(cmu1).unwrap(); diff --git a/zcash_primitives/src/transaction/components/amount.rs b/zcash_primitives/src/transaction/components/amount.rs index 556cea16b..7be908fd3 100644 --- a/zcash_primitives/src/transaction/components/amount.rs +++ b/zcash_primitives/src/transaction/components/amount.rs @@ -8,7 +8,7 @@ use orchard::value as orchard; pub const COIN: i64 = 1_0000_0000; pub const MAX_MONEY: i64 = 21_000_000 * COIN; -pub const DEFAULT_FEE: Amount = Amount(1000); +pub const DEFAULT_FEE: Amount = Amount(10_000); /// A type-safe representation of some quantity of Zcash. ///