Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tomg10 committed Dec 18, 2024
1 parent f0e0b73 commit d02804c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 27 deletions.
28 changes: 3 additions & 25 deletions core/node/l1_recovery/src/l1_fetcher/types/v1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,20 +94,8 @@ impl TryFrom<&ethabi::Token> for V1 {
};

for initial_calldata in initial_changes_calldata[4..].chunks(64) {
let mut t = initial_calldata.array_chunks::<32>();
let key = *t.next().ok_or_else(|| {
ParseError::InvalidCommitBlockInfo("initialStorageChangesKey".to_string())
})?;
let value = *t.next().ok_or_else(|| {
ParseError::InvalidCommitBlockInfo("initialStorageChangesValue".to_string())
})?;

if t.next().is_some() {
return Err(ParseError::InvalidCommitBlockInfo(
"initialStorageChangesMulti".to_string(),
));
}

let key: [u8; 32] = initial_calldata[..32].try_into().unwrap();
let value: [u8; 32] = initial_calldata[32..].try_into().unwrap();
let key = U256::from_little_endian(&key);
let _ = blk.initial_storage_changes.insert(key, value);
}
Expand All @@ -123,17 +111,7 @@ impl TryFrom<&ethabi::Token> for V1 {
repeated_calldata[6],
repeated_calldata[7],
]);
let mut t = repeated_calldata[8..].array_chunks::<32>();
let value = *t.next().ok_or_else(|| {
ParseError::InvalidCommitBlockInfo("repeatedStorageChanges".to_string())
})?;

if t.next().is_some() {
return Err(ParseError::InvalidCommitBlockInfo(
"repeatedStorageChanges".to_string(),
));
}

let value: [u8; 32] = repeated_calldata[8..].try_into().unwrap();
blk.repeated_storage_changes.insert(index, value);
}

Expand Down
2 changes: 0 additions & 2 deletions core/node/l1_recovery/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![feature(array_chunks)]
#![feature(iter_next_chunk)]
mod processor;

mod storage;
Expand Down

0 comments on commit d02804c

Please sign in to comment.