File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -66,13 +66,19 @@ threshold = 1
6666 "used_input_txs should not be empty"
6767 ) ;
6868
69+ fn h256_from_low_u64_be ( value : u64 ) -> H256 {
70+ let mut bytes = [ 0u8 ; 32 ] ;
71+ bytes[ 24 ..] . copy_from_slice ( & value. to_be_bytes ( ) ) ;
72+ H256 :: from_slice ( & bytes) . expect ( "value should fit in H256" )
73+ }
74+
6975 let sample_tx = used_input_txs. values ( ) . next ( ) . cloned ( ) . unwrap ( ) ;
7076 let mut reordered_map = Map :: new ( ) ;
7177 let extra_keys = vec ! [
72- H256 :: from_low_u64_be ( 3 ) ,
73- H256 :: from_low_u64_be ( 1 ) ,
74- H256 :: from_low_u64_be ( 4 ) ,
75- H256 :: from_low_u64_be ( 2 ) ,
78+ h256_from_low_u64_be ( 3 ) ,
79+ h256_from_low_u64_be ( 1 ) ,
80+ h256_from_low_u64_be ( 4 ) ,
81+ h256_from_low_u64_be ( 2 ) ,
7682 ] ;
7783 for key in & extra_keys {
7884 reordered_map. insert ( format ! ( "{:#x}" , key) , sample_tx. clone ( ) ) ;
You can’t perform that action at this time.
0 commit comments