Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This reduces a lot of boilerplate around fees.
Background
The boilerplate code is very prone to copy-paste errors. Changing the 14 different (but structurally identical)
FeeComponent
structs into a single one with a generic arg reduces a lot of the boilerplate code.This PR replaces #1739 (an initial, more restricted refactor) and #1794 (a PR on top of #1739). It comprises the net changes of these two PRs in the first commit, followed by most of the changes suggested by @eoroshiba's review of #1794 in the second commit.
The third commit is also in response to @eoroshiba's suggestion to remove the fee aliases, and is a single commit in case others prefer that change to be reverted.
Changes
FeeComponents<T>
whereT
will be some action type.FeeHandler
trait fairly radically to support the new form of fees.Testing
Existing tests are sufficient - there should be no changed functionality to the business logic.
Changelogs
No updates required.
Related Issues
Closes #1715.