-
Notifications
You must be signed in to change notification settings - Fork 253
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add an enumeration of standard fee rules. #1018
Conversation
Codecov ReportAttention:
📢 Thoughts on this report? Let us know!. |
61191cb
to
2f6f5f0
Compare
2861677
to
42e23b7
Compare
`StandardFeeRule` is an enumeration of the standard fees that have existed in the history of Zcash zips. It is provided to simplify transition to new fee strategies; legacy elements of this enumeration are introduced already-deprecated.
42e23b7
to
f1c0869
Compare
.compute_balance( | ||
params, | ||
target_height, | ||
transparent_inputs, | ||
transparent_outputs, | ||
sapling_inputs, | ||
sapling_outputs, | ||
dust_output_policy, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think I'll ever get used to the need for this kind of duplication in Rust :-/ I hope there's some language improvement that addresses it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK with comments.
5a2f008
to
58c88f0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK modulo the rustfmt failure.
Co-authored-by: Daira Emma Hopwood <[email protected]>
58c88f0
to
570ea48
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK
GreedyInputSelectorError<Zip317FeeError, DbT::NoteRef>, | ||
Zip317FeeError, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a change to a public API that should be documented in the changelog.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed in #1030.
/// * `change_memo`: A memo to be included in any change output that is created. | ||
#[allow(clippy::too_many_arguments)] | ||
#[allow(clippy::type_complexity)] | ||
pub fn propose_standard_transfer_to_address<DbT, ParamsT, CommitmentTreeErrT>( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This addition should be documented in the changelog.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed in #1030.
@@ -118,6 +119,28 @@ pub enum ChangeError<E, NoteRefT> { | |||
StrategyError(E), | |||
} | |||
|
|||
impl<E, NoteRefT> ChangeError<E, NoteRefT> { | |||
pub fn map<E0, F: FnOnce(E) -> E0>(self, f: F) -> ChangeError<E0, NoteRefT> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This addition should be documented in the changelog, or removed from the public API.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed in #1030.
In order to pass a
FeeRule
across a serialization boundary, it is necessary for the type of the fee rule to be known. The simplest approach to this is to add serialization for a fixed set of types.StandardFeeRule
provides such a set of known fee rules, so that we can serialize and deserialize them.Extracted from #891