Skip to content

Commit 9ac4d47

Browse files
authored
feat: add auto_impl (#85)
1 parent 953f6cb commit 9ac4d47

File tree

5 files changed

+5
-0
lines changed

5 files changed

+5
-0
lines changed

Diff for: Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ codec = { package = "parity-scale-codec", version = "2.0", default-features = fa
2121
ethereum = { version = "0.10", default-features = false }
2222
environmental = { version = "1.1.2", default-features = false, optional = true }
2323
scale-info = { version = "1.0.0", default-features = false, features = ["derive"], optional = true }
24+
auto_impl = "0.5.0"
2425

2526
[dev-dependencies]
2627
criterion = "0.3"

Diff for: runtime/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ evm-core = { version = "0.33", path = "../core", default-features = false }
1313
primitive-types = { version = "0.10", default-features = false }
1414
sha3 = { version = "0.8", default-features = false }
1515
environmental = { version = "1.1.2", default-features = false, optional = true}
16+
auto_impl = "0.5.0"
1617

1718
[features]
1819
default = ["std"]

Diff for: runtime/src/handler.rs

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ pub struct Transfer {
1414
}
1515

1616
/// EVM context handler.
17+
#[auto_impl::auto_impl(&mut, Box)]
1718
pub trait Handler {
1819
/// Type of `CREATE` interrupt.
1920
type CreateInterrupt;

Diff for: src/backend/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ pub enum Apply<I> {
5050
}
5151

5252
/// EVM backend.
53+
#[auto_impl::auto_impl(&, Arc, Box)]
5354
pub trait Backend {
5455
/// Gas price. Unused for London.
5556
fn gas_price(&self) -> U256;

Diff for: src/executor/stack/executor.rs

+1
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ impl<'config> StackSubstateMetadata<'config> {
186186
}
187187
}
188188

189+
#[auto_impl::auto_impl(&mut, Box)]
189190
pub trait StackState<'config>: Backend {
190191
fn metadata(&self) -> &StackSubstateMetadata<'config>;
191192
fn metadata_mut(&mut self) -> &mut StackSubstateMetadata<'config>;

0 commit comments

Comments
 (0)