Skip to content

Commit d02804c

Browse files
committed
fixes
1 parent f0e0b73 commit d02804c

File tree

2 files changed

+3
-27
lines changed

2 files changed

+3
-27
lines changed

core/node/l1_recovery/src/l1_fetcher/types/v1.rs

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -94,20 +94,8 @@ impl TryFrom<&ethabi::Token> for V1 {
9494
};
9595

9696
for initial_calldata in initial_changes_calldata[4..].chunks(64) {
97-
let mut t = initial_calldata.array_chunks::<32>();
98-
let key = *t.next().ok_or_else(|| {
99-
ParseError::InvalidCommitBlockInfo("initialStorageChangesKey".to_string())
100-
})?;
101-
let value = *t.next().ok_or_else(|| {
102-
ParseError::InvalidCommitBlockInfo("initialStorageChangesValue".to_string())
103-
})?;
104-
105-
if t.next().is_some() {
106-
return Err(ParseError::InvalidCommitBlockInfo(
107-
"initialStorageChangesMulti".to_string(),
108-
));
109-
}
110-
97+
let key: [u8; 32] = initial_calldata[..32].try_into().unwrap();
98+
let value: [u8; 32] = initial_calldata[32..].try_into().unwrap();
11199
let key = U256::from_little_endian(&key);
112100
let _ = blk.initial_storage_changes.insert(key, value);
113101
}
@@ -123,17 +111,7 @@ impl TryFrom<&ethabi::Token> for V1 {
123111
repeated_calldata[6],
124112
repeated_calldata[7],
125113
]);
126-
let mut t = repeated_calldata[8..].array_chunks::<32>();
127-
let value = *t.next().ok_or_else(|| {
128-
ParseError::InvalidCommitBlockInfo("repeatedStorageChanges".to_string())
129-
})?;
130-
131-
if t.next().is_some() {
132-
return Err(ParseError::InvalidCommitBlockInfo(
133-
"repeatedStorageChanges".to_string(),
134-
));
135-
}
136-
114+
let value: [u8; 32] = repeated_calldata[8..].try_into().unwrap();
137115
blk.repeated_storage_changes.insert(index, value);
138116
}
139117

core/node/l1_recovery/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![feature(array_chunks)]
2-
#![feature(iter_next_chunk)]
31
mod processor;
42

53
mod storage;

0 commit comments

Comments
 (0)