Skip to content

Commit

Permalink
Move record_external_operation to StackState trait (rust-ethereum#171)
Browse files Browse the repository at this point in the history
  • Loading branch information
sorpaas authored Jun 22, 2023
1 parent e85c34f commit b7b82c7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
10 changes: 1 addition & 9 deletions src/backend/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
mod memory;

pub use self::memory::{MemoryAccount, MemoryBackend, MemoryVicinity};
use crate::ExitError;
use alloc::vec::Vec;
use primitive_types::{H160, H256, U256};
/// Basic account information.
Expand Down Expand Up @@ -49,7 +48,7 @@ pub enum Apply<I> {
}

/// EVM backend.
//#[auto_impl::auto_impl(&, Arc, Box)]
#[auto_impl::auto_impl(&, Arc, Box)]
pub trait Backend {
/// Gas price. Unused for London.
fn gas_price(&self) -> U256;
Expand Down Expand Up @@ -84,13 +83,6 @@ pub trait Backend {
fn storage(&self, address: H160, index: H256) -> H256;
/// Get original storage value of address at index, if available.
fn original_storage(&self, address: H160, index: H256) -> Option<H256>;

fn record_external_operation(
&mut self,
_op: crate::ExternalOperation,
) -> Result<(), ExitError> {
Ok(())
}
}

/// EVM backend that can apply changes.
Expand Down
7 changes: 7 additions & 0 deletions src/executor/stack/executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,13 @@ pub trait StackState<'config>: Backend {
H256::from_slice(Keccak256::digest(self.code(address)).as_slice())
}

fn record_external_operation(
&mut self,
_op: crate::ExternalOperation,
) -> Result<(), ExitError> {
Ok(())
}

fn record_external_dynamic_opcode_cost(
&mut self,
_opcode: Opcode,
Expand Down

0 comments on commit b7b82c7

Please sign in to comment.