Skip to content

Commit 7a6c0fc

Browse files
author
Eason
committed
refactor: remove unused code
1 parent 7fb9152 commit 7a6c0fc

3 files changed

Lines changed: 6 additions & 95 deletions

File tree

core/executor/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ pub mod system_contract;
88
#[cfg(test)]
99
mod tests;
1010
mod utils;
11-
mod vm;
1211

1312
pub use crate::adapter::{AxonExecutorAdapter, MPTTrie, RocksTrieDB};
1413
pub use crate::utils::{

core/executor/src/tests/mod.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ use evm::Config;
99
use protocol::types::{
1010
Bytes, Eip1559Transaction, ExitReason, ExitSucceed, Public, SignatureComponents,
1111
SignedTransaction, TransactionAction, UnsignedTransaction, UnverifiedTransaction, H160, H256,
12-
MAX_BLOCK_GAS_LIMIT, U256,
12+
U256,
1313
};
1414
use protocol::{codec::hex_decode, traits::Executor};
1515

16-
use crate::{precompiles::build_precompile_set, vm::EvmExecutor, AxonExecutor};
16+
use crate::{precompiles::build_precompile_set, AxonExecutor as EvmExecutor, AxonExecutor};
1717

1818
fn gen_vicinity() -> MemoryVicinity {
1919
MemoryVicinity {
@@ -80,7 +80,6 @@ fn test_ackermann31() {
8080

8181
let vicinity = gen_vicinity();
8282
let mut backend = MemoryBackend::new(&vicinity, state);
83-
let executor = EvmExecutor::default();
8483
let tx = gen_tx(
8584
H160::from_str("0xf000000000000000000000000000000000000000").unwrap(),
8685
H160::from_str("0x1000000000000000000000000000000000000000").unwrap(),
@@ -89,7 +88,7 @@ fn test_ackermann31() {
8988
);
9089
let config = Config::london();
9190
let precompiles = build_precompile_set();
92-
let r = executor.inner_exec(&mut backend, &config, MAX_BLOCK_GAS_LIMIT, &precompiles, tx);
91+
let r = EvmExecutor::evm_exec(&mut backend, &config, &precompiles, &tx);
9392

9493
assert_eq!(r.exit_reason, ExitReason::Succeed(ExitSucceed::Returned));
9594
assert_eq!(r.ret, vec![
@@ -114,7 +113,6 @@ fn test_simplestorage() {
114113
let vicinity = gen_vicinity();
115114
let mut backend = MemoryBackend::new(&vicinity, state);
116115

117-
let executor = EvmExecutor::default();
118116
let config = Config::london();
119117
let precompiles = build_precompile_set();
120118

@@ -143,7 +141,7 @@ fn test_simplestorage() {
143141
tx.transaction
144142
.unsigned
145143
.set_action(TransactionAction::Create);
146-
let r = executor.inner_exec(&mut backend, &config, MAX_BLOCK_GAS_LIMIT, &precompiles, tx);
144+
let r = EvmExecutor::evm_exec(&mut backend, &config, &precompiles, &tx);
147145
assert_eq!(r.exit_reason, ExitReason::Succeed(ExitSucceed::Returned));
148146
assert!(r.ret.is_empty());
149147
assert_eq!(r.remain_gas, 29898759);
@@ -160,7 +158,7 @@ fn test_simplestorage() {
160158
hex_decode("60fe47b1000000000000000000000000000000000000000000000000000000000000002a")
161159
.unwrap(),
162160
);
163-
let r = executor.inner_exec(&mut backend, &config, MAX_BLOCK_GAS_LIMIT, &precompiles, tx);
161+
let r = EvmExecutor::evm_exec(&mut backend, &config, &precompiles, &tx);
164162
assert_eq!(r.exit_reason, ExitReason::Succeed(ExitSucceed::Stopped));
165163
assert!(r.ret.is_empty());
166164
assert_eq!(r.remain_gas, 29956491);
@@ -172,7 +170,7 @@ fn test_simplestorage() {
172170
0,
173171
hex_decode("6d4ce63c").unwrap(),
174172
);
175-
let r = executor.inner_exec(&mut backend, &config, MAX_BLOCK_GAS_LIMIT, &precompiles, tx);
173+
let r = EvmExecutor::evm_exec(&mut backend, &config, &precompiles, &tx);
176174
assert_eq!(r.exit_reason, ExitReason::Succeed(ExitSucceed::Returned));
177175
// assert_eq!(r.ret, vec![
178176
// 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,

core/executor/src/vm.rs

Lines changed: 0 additions & 86 deletions
This file was deleted.

0 commit comments

Comments
 (0)