Skip to content

Commit

Permalink
fix test provider
Browse files Browse the repository at this point in the history
  • Loading branch information
hashcashier committed Dec 11, 2024
1 parent 465de79 commit 76f9a6a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
4 changes: 4 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,17 @@ clippy:

RISC0_SKIP_BUILD=1 cargo clippy -p zeth-benchmark

RISC0_SKIP_BUILD=1 cargo clippy -p zeth-testeth

test:
cargo test --all-targets -p zeth-core -p zeth-preflight -p zeth-guests -p zeth -p zeth-benchmark -F debug-guest-build

cargo test --all-targets -p zeth-core-ethereum -p zeth-preflight-ethereum -p zeth-ethereum -F debug-guest-build

cargo test --all-targets -p zeth-core-optimism -p zeth-preflight-optimism -p zeth-optimism -F debug-guest-build

cargo test --all-targets -p zeth-testeth -F ef-tests

just test-cache-eth

test-cache-eth: (build "")
Expand Down
22 changes: 9 additions & 13 deletions testing/ef-tests/src/provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,19 +185,15 @@ impl ProviderState {
let account = self.0.get(&key);

let mut storage_proof = Vec::new();
if let Some(account) = account {
for index in indices {
let key = keccak256(index);
let (_, proof) = mpt_proof(
account.storage.iter().map(|(k, v)| (k, v.1)),
iter::once(&key),
);
storage_proof.push(EIP1186StorageProof {
key: (*index).into(),
value: account.storage.get(&key).map(|v| v.1).unwrap_or_default(),
proof,
})
}
let storage = account.map(|a| &a.storage).cloned().unwrap_or_default();
for index in indices {
let key = keccak256(index);
let (_, proof) = mpt_proof(storage.iter().map(|(k, v)| (k, v.1)), iter::once(&key));
storage_proof.push(EIP1186StorageProof {
key: (*index).into(),
value: storage.get(&key).map(|v| v.1).unwrap_or_default(),
proof,
})
}

let account = account.map(|a| a.acc.clone()).unwrap_or_default();
Expand Down

0 comments on commit 76f9a6a

Please sign in to comment.