Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/backend/memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,10 @@ impl<'vicinity> Backend for MemoryBackend<'vicinity> {
self.code(address)
}

fn init_data_as_json(&self, _address: H160) -> Vec<u8> {
Vec::new()
}

fn storage(&self, address: H160, index: H256) -> H256 {
self.state
.get(&address)
Expand Down
2 changes: 2 additions & 0 deletions src/backend/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ pub trait Backend {
fn code(&self, address: H160) -> Vec<u8>;
/// Get account code formatted as json (if possible)
fn code_as_json(&self, address: H160) -> Vec<u8>;
/// Get contract init data formatted as json (if possible)
fn init_data_as_json(&self, address: H160) -> Vec<u8>;
/// Get storage value of address at inasex.
fn storage(&self, address: H160, index: H256) -> H256;
/// Get original storage value of address at index, if available.
Expand Down
4 changes: 4 additions & 0 deletions src/executor/stack/memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,10 @@ impl<'backend, 'config, B: Backend> Backend for MemoryStackState<'backend, 'conf
self.backend.code_as_json(address)
}

fn init_data_as_json(&self, address: H160) -> Vec<u8> {
self.backend.init_data_as_json(address)
}

fn storage(&self, address: H160, key: H256) -> H256 {
self.substate
.known_storage(address, key)
Expand Down