@@ -39,7 +39,6 @@ use sp_runtime::{
3939} ;
4040use sp_state_machine:: { backend:: Backend as _, InMemoryBackend , OverlayedChanges , StateMachine } ;
4141use sp_storage:: { ChildInfo , StorageKey } ;
42- use sp_trie:: { LayoutV0 , TrieConfiguration } ;
4342use std:: { collections:: HashSet , sync:: Arc } ;
4443use substrate_test_runtime:: TestAPI ;
4544use substrate_test_runtime_client:: {
@@ -62,22 +61,17 @@ fn construct_block(
6261 backend : & InMemoryBackend < BlakeTwo256 > ,
6362 number : BlockNumber ,
6463 parent_hash : Hash ,
65- state_root : Hash ,
6664 txs : Vec < Transfer > ,
67- ) -> ( Vec < u8 > , Hash ) {
65+ ) -> Vec < u8 > {
6866 let transactions = txs. into_iter ( ) . map ( |tx| tx. into_unchecked_extrinsic ( ) ) . collect :: < Vec < _ > > ( ) ;
6967
70- let iter = transactions. iter ( ) . map ( Encode :: encode) ;
71- let extrinsics_root = LayoutV0 :: < BlakeTwo256 > :: ordered_trie_root ( iter) . into ( ) ;
72-
7368 let mut header = Header {
7469 parent_hash,
7570 number,
76- state_root,
77- extrinsics_root,
71+ state_root : Default :: default ( ) ,
72+ extrinsics_root : Default :: default ( ) ,
7873 digest : Digest { logs : vec ! [ ] } ,
7974 } ;
80- let hash = header. hash ( ) ;
8175 let mut overlay = OverlayedChanges :: default ( ) ;
8276 let backend_runtime_code = sp_state_machine:: backend:: BackendRuntimeCode :: new ( backend) ;
8377 let runtime_code = backend_runtime_code. runtime_code ( ) . expect ( "Code is part of the backend" ) ;
@@ -124,19 +118,16 @@ fn construct_block(
124118 . unwrap ( ) ;
125119 header = Header :: decode ( & mut & ret_data[ ..] ) . unwrap ( ) ;
126120
127- ( vec ! [ ] . and ( & Block { header, extrinsics : transactions } ) , hash )
121+ vec ! [ ] . and ( & Block { header, extrinsics : transactions } )
128122}
129123
130- fn block1 ( genesis_hash : Hash , backend : & InMemoryBackend < BlakeTwo256 > ) -> ( Vec < u8 > , Hash ) {
124+ fn block1 ( genesis_hash : Hash , backend : & InMemoryBackend < BlakeTwo256 > ) -> Vec < u8 > {
131125 construct_block (
132126 backend,
133127 1 ,
134128 genesis_hash,
135- array_bytes:: hex_n_into_unchecked (
136- "25e5b37074063ab75c889326246640729b40d0c86932edc527bc80db0e04fe5c" ,
137- ) ,
138129 vec ! [ Transfer {
139- from: AccountKeyring :: Alice . into( ) ,
130+ from: AccountKeyring :: One . into( ) ,
140131 to: AccountKeyring :: Two . into( ) ,
141132 amount: 69 * DOLLARS ,
142133 nonce: 0 ,
@@ -175,7 +166,7 @@ fn construct_genesis_should_work_with_native() {
175166 let genesis_hash = insert_genesis_block ( & mut storage) ;
176167
177168 let backend = InMemoryBackend :: from ( ( storage, StateVersion :: default ( ) ) ) ;
178- let ( b1data, _b1hash ) = block1 ( genesis_hash, & backend) ;
169+ let b1data = block1 ( genesis_hash, & backend) ;
179170 let backend_runtime_code = sp_state_machine:: backend:: BackendRuntimeCode :: new ( & backend) ;
180171 let runtime_code = backend_runtime_code. runtime_code ( ) . expect ( "Code is part of the backend" ) ;
181172
@@ -206,7 +197,7 @@ fn construct_genesis_should_work_with_wasm() {
206197 let genesis_hash = insert_genesis_block ( & mut storage) ;
207198
208199 let backend = InMemoryBackend :: from ( ( storage, StateVersion :: default ( ) ) ) ;
209- let ( b1data, _b1hash ) = block1 ( genesis_hash, & backend) ;
200+ let b1data = block1 ( genesis_hash, & backend) ;
210201 let backend_runtime_code = sp_state_machine:: backend:: BackendRuntimeCode :: new ( & backend) ;
211202 let runtime_code = backend_runtime_code. runtime_code ( ) . expect ( "Code is part of the backend" ) ;
212203
0 commit comments