@@ -77,8 +77,8 @@ fn marf_insert_different_leaf_same_block_100() {
77
77
merkle_test_marf (
78
78
& mut marf. borrow_storage_backend ( ) ,
79
79
& block_header,
80
- path_bytes. as_ref ( ) ,
81
- [ 99 ; 40 ] . as_ref ( ) ,
80
+ & path_bytes,
81
+ & [ 99 ; 40 ] ,
82
82
None ,
83
83
) ;
84
84
@@ -151,8 +151,8 @@ fn marf_insert_different_leaf_different_path_different_block_100() {
151
151
merkle_test_marf (
152
152
& mut marf. borrow_storage_backend ( ) ,
153
153
& block_header,
154
- path_bytes. as_ref ( ) ,
155
- [ i; 40 ] . as_ref ( ) ,
154
+ & path_bytes,
155
+ & [ i; 40 ] ,
156
156
None ,
157
157
) ;
158
158
}
@@ -232,8 +232,8 @@ fn marf_insert_same_leaf_different_block_100() {
232
232
merkle_test_marf (
233
233
& mut marf. borrow_storage_backend ( ) ,
234
234
& next_block_header,
235
- path_bytes. as_ref ( ) ,
236
- [ i; 40 ] . as_ref ( ) ,
235
+ & path_bytes,
236
+ & [ i; 40 ] ,
237
237
None ,
238
238
) ;
239
239
}
@@ -312,8 +312,8 @@ fn marf_insert_leaf_sequence_2() {
312
312
merkle_test_marf (
313
313
& mut marf. borrow_storage_backend ( ) ,
314
314
& last_block_header,
315
- path_bytes. as_ref ( ) ,
316
- [ i; 40 ] . as_ref ( ) ,
315
+ & path_bytes,
316
+ & [ i; 40 ] ,
317
317
None ,
318
318
) ;
319
319
}
@@ -380,13 +380,7 @@ fn marf_insert_leaf_sequence_100() {
380
380
381
381
assert_eq ! ( leaf. data. to_vec( ) , [ i; 40 ] . to_vec( ) ) ;
382
382
383
- merkle_test_marf (
384
- & mut f,
385
- & last_block_header,
386
- path_bytes. as_ref ( ) ,
387
- [ i; 40 ] . as_ref ( ) ,
388
- None ,
389
- ) ;
383
+ merkle_test_marf ( & mut f, & last_block_header, & path_bytes, & [ i; 40 ] , None ) ;
390
384
}
391
385
if let Some ( root_hashes) = last_root_hashes. take ( ) {
392
386
let next_root_hashes = f. read_root_to_block_table ( ) . unwrap ( ) ;
@@ -615,16 +609,14 @@ where
615
609
debug ! ( "---------------------------------------" ) ;
616
610
debug ! (
617
611
"MARF verify {:?} {:?} from current block header (immediate) {:?}" ,
618
- & prev_path,
619
- [ j as u8 ; 40 ] . as_ref( ) ,
620
- & next_block_header
612
+ & prev_path, & [ j as u8 ; 40 ] , & next_block_header
621
613
) ;
622
614
debug ! ( "----------------------------------------" ) ;
623
615
merkle_test_marf (
624
616
& mut marf. borrow_storage_backend ( ) ,
625
617
& next_block_header,
626
- prev_path. as_ref ( ) ,
627
- [ j as u8 ; 40 ] . as_ref ( ) ,
618
+ & prev_path,
619
+ & [ j as u8 ; 40 ] ,
628
620
None ,
629
621
) ;
630
622
}
@@ -640,16 +632,14 @@ where
640
632
debug ! ( "---------------------------------------" ) ;
641
633
debug ! (
642
634
"MARF verify {:?} {:?} from current block header (deferred) {:?}" ,
643
- & prev_path,
644
- [ j as u8 ; 40 ] . as_ref( ) ,
645
- & next_block_header
635
+ & prev_path, & [ j as u8 ; 40 ] , & next_block_header
646
636
) ;
647
637
debug ! ( "----------------------------------------" ) ;
648
638
merkle_test_marf (
649
639
& mut marf. borrow_storage_backend ( ) ,
650
640
& next_block_header,
651
- prev_path. as_ref ( ) ,
652
- [ j as u8 ; 40 ] . as_ref ( ) ,
641
+ & prev_path,
642
+ & [ j as u8 ; 40 ] ,
653
643
None ,
654
644
) ;
655
645
}
@@ -662,8 +652,8 @@ where
662
652
merkle_test_marf (
663
653
& mut marf. borrow_storage_backend ( ) ,
664
654
& next_block_header,
665
- next_path. as_ref ( ) ,
666
- [ i as u8 ; 40 ] . as_ref ( ) ,
655
+ & next_path,
656
+ & [ i as u8 ; 40 ] ,
667
657
None ,
668
658
) ;
669
659
}
@@ -691,16 +681,14 @@ where
691
681
debug ! ( "---------------------------------------" ) ;
692
682
debug ! (
693
683
"MARF verify {:?} {:?} from last block header {:?}" ,
694
- & next_path,
695
- [ i as u8 ; 40 ] . as_ref( ) ,
696
- & last_block_header
684
+ & next_path, & [ i as u8 ; 40 ] , & last_block_header
697
685
) ;
698
686
debug ! ( "----------------------------------------" ) ;
699
687
merkle_test_marf (
700
688
& mut marf. borrow_storage_backend ( ) ,
701
689
& last_block_header,
702
- next_path. as_ref ( ) ,
703
- [ i as u8 ; 40 ] . as_ref ( ) ,
690
+ & next_path,
691
+ & [ i as u8 ; 40 ] ,
704
692
None ,
705
693
) ;
706
694
}
@@ -882,7 +870,7 @@ fn marf_merkle_verify_backptrs() {
882
870
& mut marf. borrow_storage_backend ( ) ,
883
871
& block_header_3,
884
872
& path_3,
885
- [ 21 ; 40 ] . as_ref ( ) ,
873
+ & [ 21 ; 40 ] ,
886
874
None ,
887
875
) ;
888
876
if let Some ( root_hashes) = last_root_hashes. take ( ) {
@@ -957,7 +945,7 @@ where
957
945
root_table_cache = Some ( merkle_test_marf (
958
946
& mut marf. borrow_storage_backend ( ) ,
959
947
& block_header,
960
- path. as_ref ( ) ,
948
+ & path,
961
949
& value. data . to_vec ( ) ,
962
950
root_table_cache,
963
951
) ) ;
@@ -1018,7 +1006,7 @@ where
1018
1006
root_table_cache = Some ( merkle_test_marf (
1019
1007
& mut marf. borrow_storage_backend ( ) ,
1020
1008
& block_header,
1021
- path. as_ref ( ) ,
1009
+ & path,
1022
1010
& value. data . to_vec ( ) ,
1023
1011
root_table_cache,
1024
1012
) ) ;
@@ -1330,13 +1318,10 @@ fn marf_insert_random_10485760_4096_file_storage() {
1330
1318
seed = path. clone ( ) ;
1331
1319
1332
1320
let key = to_hex ( & path) ;
1333
- let value = to_hex (
1334
- [
1335
- 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
1336
- 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , i0 as u8 , i1 as u8 , i2 as u8 , i3 as u8 ,
1337
- ]
1338
- . as_ref ( ) ,
1339
- ) ;
1321
+ let value = to_hex ( & [
1322
+ 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
1323
+ 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , i0 as u8 , i1 as u8 , i2 as u8 , i3 as u8 ,
1324
+ ] ) ;
1340
1325
1341
1326
keys. push ( key) ;
1342
1327
values. push ( value) ;
@@ -1388,13 +1373,10 @@ fn marf_insert_random_10485760_4096_file_storage() {
1388
1373
seed = path. clone ( ) ;
1389
1374
1390
1375
let key = to_hex ( & path) ;
1391
- let value = to_hex (
1392
- [
1393
- 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
1394
- 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , i0 as u8 , i1 as u8 , i2 as u8 , i3 as u8 ,
1395
- ]
1396
- . as_ref ( ) ,
1397
- ) ;
1376
+ let value = to_hex ( & [
1377
+ 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
1378
+ 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , i0 as u8 , i1 as u8 , i2 as u8 , i3 as u8 ,
1379
+ ] ) ;
1398
1380
1399
1381
keys. push ( key) ;
1400
1382
values. push ( value) ;
@@ -1618,13 +1600,7 @@ fn marf_read_random_1048576_4096_file_storage() {
1618
1600
1619
1601
// can make a merkle proof to each one
1620
1602
if do_merkle_check {
1621
- merkle_test_marf (
1622
- & mut f,
1623
- & block_header,
1624
- path. as_ref ( ) ,
1625
- & value. data . to_vec ( ) ,
1626
- None ,
1627
- ) ;
1603
+ merkle_test_marf ( & mut f, & block_header, & path, & value. data . to_vec ( ) , None ) ;
1628
1604
}
1629
1605
if i % 128 == 0 {
1630
1606
let end_time = get_epoch_time_ms ( ) ;
@@ -1927,7 +1903,7 @@ fn marf_insert_flush_to_different_block() {
1927
1903
root_table_cache = Some ( merkle_test_marf (
1928
1904
& mut marf. borrow_storage_backend ( ) ,
1929
1905
& target_block,
1930
- path. as_ref ( ) ,
1906
+ & path,
1931
1907
& value. data . to_vec ( ) ,
1932
1908
root_table_cache,
1933
1909
) ) ;
@@ -2047,7 +2023,7 @@ fn marf_insert_flush_to_different_block() {
2047
2023
root_table_cache = Some ( merkle_test_marf (
2048
2024
& mut marf. borrow_storage_backend ( ) ,
2049
2025
& read_from_block,
2050
- path. as_ref ( ) ,
2026
+ & path,
2051
2027
& value. data . to_vec ( ) ,
2052
2028
root_table_cache,
2053
2029
) ) ;
0 commit comments