Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ratankaliani committed May 2, 2024
1 parent 2a1e46a commit 0c6000b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion plonky2x/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ digest = "0.10.7"
dotenv = "0.15.0"
ed25519-dalek = { version = "2.0.0", features = ["rand_core"] }
env_logger = "0.10.0"
ethers = { version = "2.0" }
ethers = "2.0.10"
ff = { package = "ff", version = "0.13", features = ["derive"] }
futures = "0.3.28"
hex = "0.4.3"
Expand Down
7 changes: 6 additions & 1 deletion plonky2x/core/src/frontend/eth/mpt/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,13 @@ mod tests {
);
let circuit = builder.mock_build();

let mut key_bytes = vec![];
key.to_big_endian(&mut key_bytes);

let key_bytes: [u8; 32] = key_bytes.try_into().unwrap();

let mut input = circuit.input();
input.write::<Bytes32Variable>(key);
input.write::<Bytes32Variable>(key_bytes.into());
input.write::<ArrayVariable<ArrayVariable<ByteVariable, ENCODING_LEN>, PROOF_LEN>>(
proof_as_fixed,
);
Expand Down
8 changes: 7 additions & 1 deletion plonky2x/core/src/frontend/eth/mpt/reference.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,13 @@ mod tests {
.iter()
.map(|b| b.to_vec())
.collect::<Vec<Vec<u8>>>();
let storage_key = keccak256(storage_result.storage_proof[0].key.as_bytes());

let mut key_bytes = vec![];
storage_result.storage_proof[0]
.key
.to_big_endian(&mut key_bytes);

let storage_key = keccak256(key_bytes);
let mut value = get(
storage_key.into(),
proof,
Expand Down

0 comments on commit 0c6000b

Please sign in to comment.