File tree Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change 11[package ]
22name = " trevm"
3- version = " 0.31.0 "
3+ version = " 0.31.1 "
44rust-version = " 1.83.0"
55edition = " 2021"
66authors = [" init4" ]
Original file line number Diff line number Diff line change @@ -27,6 +27,13 @@ pub trait Tx: Send + Sync {
2727 {
2828 evm. ctx . modify_tx ( |tx_env| self . fill_tx_env ( tx_env) ) ;
2929 }
30+
31+ /// Create a new [`TxEnv`] filled by this filler.
32+ fn to_tx_env ( & self ) -> TxEnv {
33+ let mut tx_env = TxEnv :: default ( ) ;
34+ self . fill_tx_env ( & mut tx_env) ;
35+ tx_env
36+ }
3037}
3138
3239impl Tx for TxEnv {
@@ -83,6 +90,13 @@ pub trait Block: Send + Sync {
8390 fn tx_count_hint ( & self ) -> Option < usize > {
8491 None
8592 }
93+
94+ /// Create a new [`BlockEnv`] filled by this filler.
95+ fn to_block_env ( & self ) -> BlockEnv {
96+ let mut block_env = BlockEnv :: default ( ) ;
97+ self . fill_block_env ( & mut block_env) ;
98+ block_env
99+ }
86100}
87101
88102impl < T > Block for T
@@ -142,6 +156,13 @@ pub trait Cfg: Send + Sync {
142156 {
143157 evm. ctx . modify_cfg ( |cfg_env| self . fill_cfg_env ( cfg_env) ) ;
144158 }
159+
160+ /// Create a new [`CfgEnv`] filled by this filler.
161+ fn to_cfg_env ( & self ) -> CfgEnv {
162+ let mut cfg_env = CfgEnv :: default ( ) ;
163+ self . fill_cfg_env ( & mut cfg_env) ;
164+ cfg_env
165+ }
145166}
146167
147168impl Cfg for Arc < dyn Cfg > {
You can’t perform that action at this time.
0 commit comments