Skip to content

Commit 0f21f79

Browse files
authored
Adds filler impls for the things that are filled (#105)
* feat: impl traits for envs * chore: version
1 parent 3dba391 commit 0f21f79

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "trevm"
3-
version = "0.20.10"
3+
version = "0.20.11"
44
rust-version = "1.83.0"
55
edition = "2021"
66
authors = ["init4"]

src/fill/traits.rs

+18
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ pub trait Tx: Send + Sync {
2727
}
2828
}
2929

30+
impl Tx for TxEnv {
31+
fn fill_tx_env(&self, tx_env: &mut TxEnv) {
32+
*tx_env = self.clone();
33+
}
34+
}
35+
3036
impl Tx for Arc<dyn Tx> {
3137
fn fill_tx_env(&self, tx_env: &mut TxEnv) {
3238
self.as_ref().fill_tx_env(tx_env);
@@ -84,6 +90,12 @@ where
8490
}
8591
}
8692

93+
impl Block for BlockEnv {
94+
fn fill_block_env(&self, block_env: &mut BlockEnv) {
95+
*block_env = self.clone();
96+
}
97+
}
98+
8799
impl Block for Arc<dyn Block> {
88100
fn fill_block_env(&self, block_env: &mut BlockEnv) {
89101
self.as_ref().fill_block_env(block_env);
@@ -132,6 +144,12 @@ impl Cfg for Arc<dyn Cfg> {
132144
}
133145
}
134146

147+
impl Cfg for CfgEnv {
148+
fn fill_cfg_env(&self, cfg_env: &mut CfgEnv) {
149+
*cfg_env = self.clone();
150+
}
151+
}
152+
135153
impl Cfg for Box<dyn Cfg> {
136154
fn fill_cfg_env(&self, cfg_env: &mut CfgEnv) {
137155
self.as_ref().fill_cfg_env(cfg_env);

0 commit comments

Comments
 (0)