Merge pull request #830 from zingolabs/update_fixed_fee_to_zip317_minimum

Update DEFAULT_FEE to 10_000 from 1000
This commit is contained in:
Kris Nuttycombe 2023-05-04 14:39:06 -06:00 committed by GitHub
commit 882d60a915
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 20 additions and 17 deletions

View File

@ -185,7 +185,7 @@ mod tests {
&Vec::<TxOut>::new(), &Vec::<TxOut>::new(),
&[TestSaplingInput { &[TestSaplingInput {
note_id: 0, note_id: 0,
value: Amount::from_u64(45000).unwrap(), value: Amount::from_u64(60000).unwrap(),
}], }],
&[SaplingPayment::new(Amount::from_u64(40000).unwrap())], &[SaplingPayment::new(Amount::from_u64(40000).unwrap())],
&DustOutputPolicy::default(), &DustOutputPolicy::default(),
@ -193,8 +193,8 @@ mod tests {
assert_matches!( assert_matches!(
result, result,
Ok(balance) if balance.proposed_change() == [ChangeValue::Sapling(Amount::from_u64(4000).unwrap())] Ok(balance) if balance.proposed_change() == [ChangeValue::Sapling(Amount::from_u64(10000).unwrap())]
&& balance.fee_required() == Amount::from_u64(1000).unwrap() && balance.fee_required() == Amount::from_u64(10000).unwrap()
); );
} }
@ -218,7 +218,7 @@ mod tests {
// enough to pay a fee, plus dust // enough to pay a fee, plus dust
TestSaplingInput { TestSaplingInput {
note_id: 0, note_id: 0,
value: Amount::from_u64(1100).unwrap(), value: Amount::from_u64(10100).unwrap(),
}, },
], ],
&[SaplingPayment::new(Amount::from_u64(40000).unwrap())], &[SaplingPayment::new(Amount::from_u64(40000).unwrap())],
@ -228,7 +228,7 @@ mod tests {
assert_matches!( assert_matches!(
result, result,
Err(ChangeError::InsufficientFunds { available, required }) 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()
); );
} }
} }

View File

@ -354,7 +354,7 @@ mod tests {
available, available,
required 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 required
}) })
if available == Amount::from_u64(50000).unwrap() 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 // Mine blocks SAPLING_ACTIVATION_HEIGHT + 2 to 9 until just before the second
@ -472,7 +472,7 @@ mod tests {
required required
}) })
if available == Amount::from_u64(50000).unwrap() 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 // Mine block 11 so that the second note becomes verified
@ -568,7 +568,7 @@ mod tests {
available, available,
required 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) // Mine blocks SAPLING_ACTIVATION_HEIGHT + 1 to 21 (that don't send us funds)
@ -602,7 +602,7 @@ mod tests {
available, available,
required 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 // 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(); let dfvk = usk.sapling().to_diversifiable_full_viewing_key();
// Add funds to the wallet in a single note // 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( let (cb, _) = fake_compact_block(
sapling_activation_height(), sapling_activation_height(),
BlockHash([0; 32]), BlockHash([0; 32]),
@ -806,7 +806,7 @@ mod tests {
let dfvk = usk.sapling().to_diversifiable_full_viewing_key(); let dfvk = usk.sapling().to_diversifiable_full_viewing_key();
// Add funds to the wallet in a single note // 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( let (cb, _) = fake_compact_block(
sapling_activation_height(), sapling_activation_height(),
BlockHash([0; 32]), BlockHash([0; 32]),

View File

@ -814,7 +814,7 @@ mod tests {
// create some inputs to spend // create some inputs to spend
let extsk = ExtendedSpendingKey::master(&[]); let extsk = ExtendedSpendingKey::master(&[]);
let to = extsk.default_address().1; 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(&note1.cmu()); let cm1 = Node::from_cmu(&note1.cmu());
let mut tree = CommitmentTree::empty(); let mut tree = CommitmentTree::empty();
// fake that the note appears in some previous // fake that the note appears in some previous

View File

@ -6,6 +6,9 @@ and this library adheres to Rust's notion of
[Semantic Versioning](https://semver.org/spec/v2.0.0.html). [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased] ## [Unreleased]
### Changed
- `zcash_primitives::transactions::component::amount::DEFAULT_FEE` increased zip317
minimum possible fee.
## [0.11.0] - 2023-04-15 ## [0.11.0] - 2023-04-15
### Added ### Added

View File

@ -653,7 +653,7 @@ mod tests {
builder builder
.add_transparent_output( .add_transparent_output(
&TransparentAddress::PublicKey([0; 20]), &TransparentAddress::PublicKey([0; 20]),
Amount::from_u64(49000).unwrap(), Amount::from_u64(40000).unwrap(),
) )
.unwrap(); .unwrap();
@ -689,7 +689,7 @@ mod tests {
builder builder
.add_transparent_output( .add_transparent_output(
&TransparentAddress::PublicKey([0; 20]), &TransparentAddress::PublicKey([0; 20]),
Amount::from_u64(49000).unwrap(), Amount::from_u64(40000).unwrap(),
) )
.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(&note1.cmu()); let cmu1 = Node::from_cmu(&note1.cmu());
let mut tree = CommitmentTree::empty(); let mut tree = CommitmentTree::empty();
tree.append(cmu1).unwrap(); tree.append(cmu1).unwrap();

View File

@ -8,7 +8,7 @@ use orchard::value as orchard;
pub const COIN: i64 = 1_0000_0000; pub const COIN: i64 = 1_0000_0000;
pub const MAX_MONEY: i64 = 21_000_000 * COIN; 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. /// A type-safe representation of some quantity of Zcash.
/// ///