@@ -272,8 +272,8 @@ fn solidity_encode_bytes(
272272///
273273/// # Developer Note
274274///
275- // The implementation does not use `.div_ceil()`, as that function is more complex
276- // and would use up more stack space.
275+ /// The implementation does not use `.div_ceil()`, as that function is more complex
276+ /// and would use up more stack space.
277277#[ allow( clippy:: manual_div_ceil) ]
278278#[ inline( always) ]
279279const fn solidity_padded_len ( len : usize ) -> usize {
@@ -1382,11 +1382,12 @@ impl TypedEnvBackend for EnvInstance {
13821382 // 96 because 64 for `Weight` and 32 for `bytes` offset
13831383 let n = solidity_encode_bytes ( enc_msg, 96 , 0 , & mut buffer[ 4 ..] ) ;
13841384
1385- let mut weight_bytes = [ 0u8 ; 64 ] ;
1386- weight_bytes[ 24 ..32 ] . copy_from_slice ( & weight. ref_time ( ) . to_be_bytes ( ) ) ;
1387- weight_bytes[ 56 ..64 ] . copy_from_slice ( & weight. proof_size ( ) . to_be_bytes ( ) ) ;
13881385 // put the `Weight` after the `bytes` offset word
1389- buffer[ 4 + 32 ..4 + 32 + 64 ] . copy_from_slice ( & weight_bytes[ ..] ) ;
1386+ // 4 bytes for the selector + 32 bytes for the `bytes` offset word
1387+ buffer[ 4 + 32 + 24 ..4 + 32 + 32 ]
1388+ . copy_from_slice ( & weight. ref_time ( ) . to_be_bytes ( ) [ ..] ) ;
1389+ buffer[ 4 + 32 + 32 + 24 ..4 + 32 + 32 + 32 ]
1390+ . copy_from_slice ( & weight. proof_size ( ) . to_be_bytes ( ) [ ..] ) ;
13901391
13911392 let _call_result = ext:: call (
13921393 CallFlags :: empty ( ) ,
0 commit comments