@@ -42,7 +42,7 @@ impl WitLoad for [u8; 20] {
4242 let mut dest = [ 0u8 ; 20 ] ;
4343 dest[ 0 ..8 ] . copy_from_slice ( & part1. to_be_bytes ( ) ) ;
4444 dest[ 8 ..16 ] . copy_from_slice ( & part2. to_be_bytes ( ) ) ;
45- dest[ 16 ..20 ] . copy_from_slice ( & part3. to_be_bytes ( ) ) ;
45+ dest[ 16 ..20 ] . copy_from_slice ( & part3. to_be_bytes ( ) [ 0 .. 4 ] ) ;
4646 Ok ( dest)
4747 }
4848
@@ -58,7 +58,7 @@ impl WitLoad for [u8; 20] {
5858 let mut dest = [ 0u8 ; 20 ] ;
5959 dest[ 0 ..8 ] . copy_from_slice ( & part1. to_be_bytes ( ) ) ;
6060 dest[ 8 ..16 ] . copy_from_slice ( & part2. to_be_bytes ( ) ) ;
61- dest[ 16 ..20 ] . copy_from_slice ( & part3. to_be_bytes ( ) ) ;
61+ dest[ 16 ..20 ] . copy_from_slice ( & part3. to_be_bytes ( ) [ 0 .. 4 ] ) ;
6262 Ok ( dest)
6363 }
6464}
@@ -75,7 +75,7 @@ impl WitStore for [u8; 20] {
7575 {
7676 let part1 = u64:: from_be_bytes ( self [ 0 ..8 ] . try_into ( ) . unwrap ( ) ) ;
7777 let part2 = u64:: from_be_bytes ( self [ 8 ..16 ] . try_into ( ) . unwrap ( ) ) ;
78- let part3 = u64 :: from_be_bytes ( self [ 16 ..20 ] . try_into ( ) . unwrap ( ) ) ;
78+ let part3 = ( u32 :: from_be_bytes ( self [ 16 ..20 ] . try_into ( ) . unwrap ( ) ) as u64 ) << 32 ;
7979 ( part1, part2, part3) . store ( memory, location)
8080 }
8181
@@ -89,7 +89,7 @@ impl WitStore for [u8; 20] {
8989 {
9090 let part1 = u64:: from_be_bytes ( self [ 0 ..8 ] . try_into ( ) . unwrap ( ) ) ;
9191 let part2 = u64:: from_be_bytes ( self [ 8 ..16 ] . try_into ( ) . unwrap ( ) ) ;
92- let part3 = u64 :: from_be_bytes ( self [ 16 ..20 ] . try_into ( ) . unwrap ( ) ) ;
92+ let part3 = ( u32 :: from_be_bytes ( self [ 16 ..20 ] . try_into ( ) . unwrap ( ) ) as u64 ) << 32 ;
9393 ( part1, part2, part3) . lower ( memory)
9494 }
9595}
0 commit comments