forked from Sovereign-Labs/sovereign-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add associated types as tx hooks args (Sovereign-Labs#1225)
* feat: add associated types as tx hooks args This commit introduces associated types to the `TxHooks` trait, enhancing its ability to define custom interactions between the trait and its implementing modules. The associated types allow for greater flexibility in the implementation of `TxHooks`, enabling diverse use cases beyond the current `Accounts` module. The current `Accounts` implementation of `TxHooks` serves the purpose of extracting a public key from a transaction and mapping it to a rollup address, creating an execution context. This functionality is achieved through the `pre_dispatch_tx_hook` signature which returns a `C::Address`. However, this tight coupling with the `accounts` module restricts future expansions of `TxHooks`. With this modification, hooks gain increased versatility and modules are free to implement them as per their requirements. Additionally, runtimes can consume these implementations, utilizing them as essential building blocks, while the banks module is empowered to enforce a gas cap on the pre-dispatch hook. * stf blueprint runtime tx hooks should return address * add sequencer as argument of context * fix missing test * gen random sequencer for test
- Loading branch information
Showing
45 changed files
with
340 additions
and
153 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.