@@ -7655,7 +7655,7 @@ fn test_block_with_drpool_and_utxo_set<F: FnMut(&mut Block) -> bool>(
76557655 } ;
76567656
76577657 let mut block_header = BlockHeader :: default ( ) ;
7658- build_merkle_tree ( & mut block_header, & txns) ;
7658+ block_header. merkle_roots = BlockMerkleRoots :: from_transactions ( & txns) ;
76597659 block_header. beacon = block_beacon;
76607660 block_header. proof = BlockEligibilityClaim :: create ( vrf, & secret_key, vrf_input) . unwrap ( ) ;
76617661
@@ -7698,18 +7698,6 @@ fn test_block_with_drpool_and_utxo_set<F: FnMut(&mut Block) -> bool>(
76987698 Ok ( ( ) )
76997699}
77007700
7701- fn build_merkle_tree ( block_header : & mut BlockHeader , txns : & BlockTransactions ) {
7702- let merkle_roots = BlockMerkleRoots {
7703- mint_hash : txns. mint . hash ( ) ,
7704- vt_hash_merkle_root : merkle_tree_root ( & txns. value_transfer_txns ) ,
7705- dr_hash_merkle_root : merkle_tree_root ( & txns. data_request_txns ) ,
7706- commit_hash_merkle_root : merkle_tree_root ( & txns. commit_txns ) ,
7707- reveal_hash_merkle_root : merkle_tree_root ( & txns. reveal_txns ) ,
7708- tally_hash_merkle_root : merkle_tree_root ( & txns. tally_txns ) ,
7709- } ;
7710- block_header. merkle_roots = merkle_roots;
7711- }
7712-
77137701///////////////////////////////////////////////////////////////////////////////
77147702// Block tests: one block
77157703///////////////////////////////////////////////////////////////////////////////
@@ -7942,7 +7930,7 @@ fn block_difficult_proof() {
79427930 } ;
79437931
79447932 let mut block_header = BlockHeader :: default ( ) ;
7945- build_merkle_tree ( & mut block_header, & txns) ;
7933+ block_header. merkle_roots = BlockMerkleRoots :: from_transactions ( & txns) ;
79467934 block_header. beacon = block_beacon;
79477935 block_header. proof = BlockEligibilityClaim :: create ( vrf, & secret_key, vrf_input) . unwrap ( ) ;
79487936
@@ -8163,7 +8151,7 @@ fn block_duplicated_commits() {
81638151 } ] ,
81648152 ) ;
81658153
8166- build_merkle_tree ( & mut b. block_header , & b. txns ) ;
8154+ b. block_header . merkle_roots = BlockMerkleRoots :: from_transactions ( & b. txns ) ;
81678155
81688156 true
81698157 } ,
@@ -8271,7 +8259,7 @@ fn block_duplicated_reveals() {
82718259 } ] ,
82728260 ) ;
82738261
8274- build_merkle_tree ( & mut b. block_header , & b. txns ) ;
8262+ b. block_header . merkle_roots = BlockMerkleRoots :: from_transactions ( & b. txns ) ;
82758263
82768264 true
82778265 } ,
@@ -8338,7 +8326,7 @@ fn block_duplicated_tallies() {
83388326 } ] ,
83398327 ) ;
83408328
8341- build_merkle_tree ( & mut b. block_header , & b. txns ) ;
8329+ b. block_header . merkle_roots = BlockMerkleRoots :: from_transactions ( & b. txns ) ;
83428330
83438331 true
83448332 } ,
@@ -8395,7 +8383,7 @@ fn block_before_and_after_hard_fork() {
83958383 } ] ,
83968384 ) ;
83978385
8398- build_merkle_tree ( & mut b. block_header , & b. txns ) ;
8386+ b. block_header . merkle_roots = BlockMerkleRoots :: from_transactions ( & b. txns ) ;
83998387
84008388 true
84018389 } ,
@@ -8418,7 +8406,7 @@ fn block_before_and_after_hard_fork() {
84188406 } ] ,
84198407 ) ;
84208408
8421- build_merkle_tree ( & mut b. block_header , & b. txns ) ;
8409+ b. block_header . merkle_roots = BlockMerkleRoots :: from_transactions ( & b. txns ) ;
84228410
84238411 true
84248412 } ,
@@ -8643,7 +8631,7 @@ fn test_blocks_with_limits(
86438631 hash_prev_block : last_block_hash,
86448632 } ;
86458633 let mut block_header = BlockHeader :: default ( ) ;
8646- build_merkle_tree ( & mut block_header, & txns) ;
8634+ block_header. merkle_roots = BlockMerkleRoots :: from_transactions ( & txns) ;
86478635 block_header. beacon = block_beacon;
86488636 block_header. proof = BlockEligibilityClaim :: create ( vrf, & secret_key, vrf_input) . unwrap ( ) ;
86498637
@@ -9422,7 +9410,7 @@ fn validate_block_transactions_uses_block_number_in_utxo_diff() {
94229410 } ;
94239411
94249412 let mut block_header = BlockHeader :: default ( ) ;
9425- build_merkle_tree ( & mut block_header, & txns) ;
9413+ block_header. merkle_roots = BlockMerkleRoots :: from_transactions ( & txns) ;
94269414 block_header. beacon = block_beacon;
94279415 block_header. proof = BlockEligibilityClaim :: create ( vrf, & secret_key, vrf_input) . unwrap ( ) ;
94289416
@@ -9585,7 +9573,7 @@ fn validate_commit_transactions_included_in_utxo_diff() {
95859573 txns. commit_txns . push ( c_tx) ;
95869574
95879575 let mut block_header = BlockHeader :: default ( ) ;
9588- build_merkle_tree ( & mut block_header, & txns) ;
9576+ block_header. merkle_roots = BlockMerkleRoots :: from_transactions ( & txns) ;
95899577 block_header. beacon = block_beacon;
95909578 block_header. proof = BlockEligibilityClaim :: create ( vrf, & secret_key, vrf_input) . unwrap ( ) ;
95919579
0 commit comments