@@ -94,20 +94,8 @@ impl TryFrom<ðabi::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<ðabi::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
0 commit comments