Skip to content

Commit

Permalink
Add a MARGINAL_FEE constant for the ZIP 317 marginal fee
Browse files Browse the repository at this point in the history
  • Loading branch information
zancas committed Oct 9, 2023
1 parent b9f8ec8 commit 2e7701e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions zcash_primitives/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ and this library adheres to Rust's notion of
## [Unreleased]
### Added
- Trait implementation `Mul<usize>` for `NonNegativeAmount`.
- Added `pub const MARGINAL_FEE: Amount`
`zcash_primitives::transaction::fees::zip317::MARGINAL_FEE`

## [0.13.0-rc.1] - 2023-09-08
### Added
Expand Down
8 changes: 7 additions & 1 deletion zcash_primitives/src/transaction/fees/zip317.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ use crate::{
/// [ZIP 317]: https//zips.z.cash/zip-0317
pub const MINIMUM_FEE: Amount = Amount::const_from_i64(10_000);

/// The marginal fee using the standard [ZIP 317] constants. Equivalent to
/// `FeeRule::standard().marginal_fee()`, but as a constant.
///
/// [ZIP 317]: https//zips.z.cash/zip-0317
pub const MARGINAL_FEE: Amount = Amount::const_from_i64(5_000);

/// A [`FeeRule`] implementation that implements the [ZIP 317] fee rule.
///
/// This fee rule supports only P2pkh transparent inputs; an error will be returned if a coin
Expand All @@ -42,7 +48,7 @@ impl FeeRule {
/// [ZIP 317]: https//zips.z.cash/zip-0317
pub fn standard() -> Self {
Self {
marginal_fee: Amount::from_u64(5000).unwrap(),
marginal_fee: MARGINAL_FEE,
grace_actions: 2,
p2pkh_standard_input_size: 150,
p2pkh_standard_output_size: 34,
Expand Down

0 comments on commit 2e7701e

Please sign in to comment.