Skip to content

Commit fa9c331

Browse files
renamed get_storage_slot() to get_storage()
1 parent 717e3ff commit fa9c331

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

cmd/ef_tests/state/runner/levm_runner.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ pub fn ensure_pre_state(evm: &VM, test: &EFTest) -> Result<(), EFTestRunnerError
238238
)?;
239239
for (k, v) in &pre_value.storage {
240240
let storage_slot = world_state
241-
.get_storage_slot(*address, H256::from_slice(&k.to_big_endian()))
241+
.get_storage(*address, H256::from_slice(&k.to_big_endian()))
242242
.unwrap();
243243
ensure_pre_state_condition(
244244
&storage_slot == v,

crates/vm/backends/levm/db.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@ impl LevmDatabase for DatabaseLogger {
4848
self.store.account_exists(address)
4949
}
5050

51-
fn get_storage_slot(
51+
fn get_storage(
5252
&self,
5353
address: CoreAddress,
5454
key: CoreH256,
5555
) -> Result<CoreU256, DatabaseError> {
56-
let slot = self.store.get_storage_slot(address, key)?;
56+
let slot = self.store.get_storage(address, key)?;
5757
self.storage_accessed
5858
.lock()
5959
.map_err(|_| DatabaseError::Custom("Could not lock mutex".to_string()))?
@@ -140,7 +140,7 @@ impl LevmDatabase for StoreWrapper {
140140
acc_info.is_some()
141141
}
142142

143-
fn get_storage_slot(
143+
fn get_storage(
144144
&self,
145145
address: CoreAddress,
146146
key: CoreH256,
@@ -216,7 +216,7 @@ impl LevmDatabase for ExecutionDB {
216216
Ok(self.block_hashes.get(&block_number).cloned())
217217
}
218218

219-
fn get_storage_slot(
219+
fn get_storage(
220220
&self,
221221
address: CoreAddress,
222222
key: CoreH256,

crates/vm/backends/levm/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ impl LEVM {
192192
// 2. Storage has been updated if the current value is different from the one before execution.
193193
let mut added_storage = HashMap::new();
194194
for (key, storage_slot) in &new_state_account.storage {
195-
let storage_before_block = db.store.get_storage_slot(address, *key)?;
195+
let storage_before_block = db.store.get_storage(address, *key)?;
196196
if storage_slot.current_value != storage_before_block {
197197
added_storage.insert(*key, storage_slot.current_value);
198198
storage_updated = true;

crates/vm/levm/src/db/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ pub mod error;
1212

1313
pub trait Database: Send + Sync {
1414
fn get_account_info(&self, address: Address) -> Result<AccountInfo, DatabaseError>;
15-
fn get_storage_slot(&self, address: Address, key: H256) -> Result<U256, DatabaseError>;
15+
fn get_storage(&self, address: Address, key: H256) -> Result<U256, DatabaseError>;
1616
fn get_block_hash(&self, block_number: u64) -> Result<Option<H256>, DatabaseError>;
1717
fn account_exists(&self, address: Address) -> bool;
1818
fn get_chain_config(&self) -> ChainConfig;

crates/vm/levm/src/vm.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -488,15 +488,15 @@ impl<'a> VM<'a> {
488488
Some(account) => match account.storage.get(&key) {
489489
Some(storage_slot) => storage_slot.clone(),
490490
None => {
491-
let value = self.db.store.get_storage_slot(address, key)?;
491+
let value = self.db.store.get_storage(address, key)?;
492492
StorageSlot {
493493
original_value: value,
494494
current_value: value,
495495
}
496496
}
497497
},
498498
None => {
499-
let value = self.db.store.get_storage_slot(address, key)?;
499+
let value = self.db.store.get_storage(address, key)?;
500500
StorageSlot {
501501
original_value: value,
502502
current_value: value,

0 commit comments

Comments
 (0)