`zcash_primitives::transaction::fees::zip317::FeeRule::non_standard` has

been deprecated, because in general it can calculate fees that violate
ZIP 317, which might cause transactions built with it to fail. Maintaining
the generality of the current implementation imposes ongoing maintenance
costs, and so it is likely to be removed in the near future.

Use `transaction::fees::zip317::FeeRule::standard()` instead to comply
with ZIP 317.

Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
This commit is contained in:
Daira-Emma Hopwood 2024-06-28 17:55:15 +01:00
parent baccb4361b
commit 9c082dca3e
2 changed files with 15 additions and 0 deletions

View File

@ -44,6 +44,14 @@ and this library adheres to Rust's notion of
(expressed as iterators of `InputSize` for inputs and `usize` for outputs)
rather than a slice of `InputView` or `OutputView`.
### Deprecated
- `zcash_primitives::transaction::fees::zip317::FeeRule::non_standard` has been
deprecated, because in general it can calculate fees that violate ZIP 317, which
might cause transactions built with it to fail. Maintaining the generality of the
current implementation imposes ongoing maintenance costs, and so it is likely to
be removed in the near future. Use `transaction::fees::zip317::FeeRule::standard()`
instead to comply with ZIP 317.
### Removed
- The `zcash_primitives::zip339` module, which reexported parts of the API of
the `bip0039` crate, has been removed. Use the `bip0039` crate directly

View File

@ -78,6 +78,13 @@ impl FeeRule {
///
/// Returns `None` if either `p2pkh_standard_input_size` or `p2pkh_standard_output_size` are
/// zero.
#[deprecated(
note = "Using this fee rule with `marginal_fee < 5000 || grace_actions < 2 \
|| p2pkh_standard_input_size > P2PKH_STANDARD_INPUT_SIZE \
|| p2pkh_standard_output_size > P2PKH_STANDARD_OUTPUT_SIZE` \
violates ZIP 317, and might cause transactions built with it to fail. \
This API is likely to be removed. Use `[FeeRule::standard]` instead."
)]
pub fn non_standard(
marginal_fee: NonNegativeAmount,
grace_actions: usize,