Skip to content

Commit

Permalink
small refac (#753)
Browse files Browse the repository at this point in the history
  • Loading branch information
tcoratger authored Sep 12, 2024
1 parent 1ead5f7 commit c0da0a1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion crates/ef-testing/src/evm_sequencer/evm_state/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ impl Evm for KakarotSequencer {
self.state_mut().set_storage_at(
kakarot_address,
get_storage_var_address(KAKAROT_COINBASE, &[]),
coinbase_address.into(),
coinbase_address,
)?;

// Set the base fee.
Expand Down
10 changes: 4 additions & 6 deletions crates/ef-testing/src/models/case.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,8 @@ impl BlockchainTestCase {
sequencer: &mut KakarotSequencer,
) -> Result<EVMOutput, RunnerError> {
// we extract the transactions from the block
let block = &self.block;
let block =
SealedBlock::decode(&mut block.rlp.as_ref()).map_err(RunnerError::RlpDecodeError)?;
let block = SealedBlock::decode(&mut self.block.rlp.as_ref())
.map_err(RunnerError::RlpDecodeError)?;

let mut output = EVMOutput::default();

Expand Down Expand Up @@ -145,7 +144,7 @@ impl BlockchainTestCase {
let post_state = self.post.clone().expect("Post state not found");
let post_state = update_post_state(post_state, self.pre.clone());

let mut errors: Vec<String> = vec![];
let mut errors = Vec::new();

let actual_gas_used = output.gas_used;
let expected_gas_u64: u64 = expected_gas_used.try_into().unwrap();
Expand Down Expand Up @@ -176,8 +175,7 @@ impl BlockchainTestCase {
}

// Nonce
#[allow(unused_mut)]
let mut actual = sequencer.nonce_at(address)?;
let actual = sequencer.nonce_at(address)?;
if actual != expected_state.nonce {
let nonce_diff = format!(
"nonce mismatch for {:#20x}: expected {:#32x}, got {:#32x}",
Expand Down

0 comments on commit c0da0a1

Please sign in to comment.