-
Notifications
You must be signed in to change notification settings - Fork 603
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: custom evm with generic handlers
- Loading branch information
1 parent
e5c9f34
commit 181ea9a
Showing
6 changed files
with
123 additions
and
86 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,31 @@ | ||
pub mod pre_execution; | ||
pub mod post_execution; | ||
pub mod pre_execution; | ||
pub mod validation; | ||
|
||
pub use pre_execution::Erc20PreExecution; | ||
use revm::{ | ||
context::{block::BlockEnv, tx::TxEnv, CfgEnv, Context}, | ||
context_interface::result::{EVMError, InvalidTransaction}, | ||
database_interface::Database, | ||
handler::{EthExecution, EthHandler}, | ||
Evm, | ||
}; | ||
|
||
pub use post_execution::Erc20PostExecution; | ||
pub use validation::Erc20Validation; | ||
pub use pre_execution::Erc20PreExecution; | ||
pub use validation::Erc20Validation; | ||
|
||
pub type Erc20Error<DB> = EVMError<<DB as Database>::Error, InvalidTransaction>; | ||
|
||
pub type Erc20Context<DB> = Context<BlockEnv, TxEnv, CfgEnv, DB>; | ||
|
||
pub type Erc20Handler< | ||
CTX, | ||
ERROR, | ||
VAL = Erc20Validation<CTX, ERROR>, | ||
PREEXEC = Erc20PreExecution<CTX, ERROR>, | ||
EXEC = EthExecution<CTX, ERROR>, | ||
POSTEXEC = Erc20PostExecution<CTX, ERROR>, | ||
> = EthHandler<CTX, ERROR, VAL, PREEXEC, EXEC, POSTEXEC>; | ||
|
||
pub type Erc20Evm<DB> = | ||
Evm<Erc20Error<DB>, Erc20Context<DB>, Erc20Handler<Erc20Context<DB>, Erc20Error<DB>>>; |
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.