Bumped eth_trie_utils to 0.3.1

This commit is contained in:
BGluth 2022-10-24 16:23:03 -06:00
parent 84151f083c
commit 2e7da17554
3 changed files with 6 additions and 6 deletions

View File

@ -7,7 +7,7 @@ edition = "2021"
[dependencies]
plonky2 = { path = "../plonky2", default-features = false, features = ["rand", "timing"] }
plonky2_util = { path = "../util" }
eth_trie_utils = "0.2.1"
eth_trie_utils = "0.3.1"
anyhow = "1.0.40"
env_logger = "0.9.0"
ethereum-types = "0.14.0"

View File

@ -142,7 +142,7 @@ fn mpt_insert_branch_to_leaf_same_key() -> Result<()> {
/// Note: The account's storage_root is ignored, as we can't insert a new storage_root without the
/// accompanying trie data. An empty trie's storage_root is used instead.
fn test_state_trie(state_trie: PartialTrie, k: Nibbles, mut account: AccountRlp) -> Result<()> {
fn test_state_trie(mut state_trie: PartialTrie, k: Nibbles, mut account: AccountRlp) -> Result<()> {
assert_eq!(k.count, 64);
// Ignore any storage_root; see documentation note.
@ -207,8 +207,8 @@ fn test_state_trie(state_trie: PartialTrie, k: Nibbles, mut account: AccountRlp)
);
let hash = H256::from_uint(&interpreter.stack()[0]);
let updated_trie = state_trie.insert(k, rlp::encode(&account).to_vec());
let expected_state_trie_hash = updated_trie.calc_hash();
state_trie.insert(k, rlp::encode(&account).to_vec());
let expected_state_trie_hash = state_trie.calc_hash();
assert_eq!(hash, expected_state_trie_hash);
Ok(())

View File

@ -109,7 +109,7 @@ pub(crate) fn mpt_prover_inputs_state_trie(
prover_inputs.push(U256::zero()); // value_present = 0
for (i, child) in children.iter().enumerate() {
let extended_key = key.merge(&Nibbles {
let extended_key = key.merge_nibbles(&Nibbles {
count: 1,
packed: i.into(),
});
@ -124,7 +124,7 @@ pub(crate) fn mpt_prover_inputs_state_trie(
PartialTrie::Extension { nibbles, child } => {
prover_inputs.push(nibbles.count.into());
prover_inputs.push(nibbles.packed);
let extended_key = key.merge(nibbles);
let extended_key = key.merge_nibbles(nibbles);
mpt_prover_inputs_state_trie(
child,
extended_key,