-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Transaction Fee Module #1648
Transaction Fee Module #1648
Conversation
|
Looks like an overall good direction! |
pepyakin
left a comment
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 looks good! It is difficult for me to see though how the implementation for UTXO chains would look like.
|
@pepyakin It is hard to be confident this will actually work with UTXO implementation without actually integrate with it, but here are my thoughts: The UTXO module will implement |
|
@shawntabrizi @pepyakin This is ready for review |
shawntabrizi
left a comment
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.
Looks good to me :)
bkchr
left a comment
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.
Just some nitpicks.
|
@bkchr can you have a look again and maybe merge it? This is ready and we would like to have this included to unblock us from next task, which is refactor balances and contract module to use this to charge fee. This then will make it possible to block explorer to easily fetch the total transaction fee of a transfer and then produce an accurate balance statement easily. |
|
Will take a last look tomorrow morning and merge then probably. |
* wip * Split bytes fee charging and charging by amount into different traits. * Move to edition 2018. * Implemented charge fee traits for fees module. * Implemented 'on_finalise' for fee module. * Updated fees finalize impl. * Renaming and documentation update. * Added overflow & underflow check for fee calculation. * Added mock and unit tests for fee module. * More unit tests for fees module. * Fixed srml-executive unit tests. * Remove transaction base/bytes fee from balances module, fix unit tests. * fix compile error * Fixed unit test. * Minor fixes. * Bump spec version. * Bump spec version. * Updated fees module and runtime wasm. * Fees module code style improvement; updated runtime wasm. * Bump spec and impl version.
This introduces
ChargeFeeandTransferAssettrait which reduces the coupling between balances module and other modules.A new
Feesmodule is added to handle all transaction fee related work. Later it can be used to handle transaction fee distribution. It also provide a unifiedChargedeven to simplify client side transaction fee listening.The new module and traits should be able to handle various kinds of token implementations (current balances module, multi token module, UTXO module).
Close #1515
Relates to #1514
May conflicts to #1641