@@ -76,7 +76,7 @@ pub use sc_client_api::{
7676 } ,
7777 execution_extensions:: { ExecutionExtensions , ExecutionStrategies } ,
7878 notifications:: { StorageNotifications , StorageEventStream } ,
79- CallExecutor , ExecutorProvider , ProofProvider ,
79+ CallExecutor , ExecutorProvider , ProofProvider , CloneableSpawn ,
8080} ;
8181use sp_blockchain:: Error ;
8282use prometheus_endpoint:: Registry ;
@@ -135,6 +135,7 @@ pub fn new_in_mem<E, Block, S, RA>(
135135 genesis_storage : & S ,
136136 keystore : Option < sp_core:: traits:: BareCryptoStorePtr > ,
137137 prometheus_registry : Option < Registry > ,
138+ spawn_handle : Box < dyn CloneableSpawn > ,
138139) -> sp_blockchain:: Result < Client <
139140 in_mem:: Backend < Block > ,
140141 LocalCallExecutor < in_mem:: Backend < Block > , E > ,
@@ -145,7 +146,7 @@ pub fn new_in_mem<E, Block, S, RA>(
145146 S : BuildStorage ,
146147 Block : BlockT ,
147148{
148- new_with_backend ( Arc :: new ( in_mem:: Backend :: new ( ) ) , executor, genesis_storage, keystore, prometheus_registry)
149+ new_with_backend ( Arc :: new ( in_mem:: Backend :: new ( ) ) , executor, genesis_storage, keystore, spawn_handle , prometheus_registry)
149150}
150151
151152/// Create a client with the explicitly provided backend.
@@ -155,6 +156,7 @@ pub fn new_with_backend<B, E, Block, S, RA>(
155156 executor : E ,
156157 build_genesis_storage : & S ,
157158 keystore : Option < sp_core:: traits:: BareCryptoStorePtr > ,
159+ spawn_handle : Box < dyn CloneableSpawn > ,
158160 prometheus_registry : Option < Registry > ,
159161) -> sp_blockchain:: Result < Client < B , LocalCallExecutor < B , E > , Block , RA > >
160162 where
@@ -163,7 +165,7 @@ pub fn new_with_backend<B, E, Block, S, RA>(
163165 Block : BlockT ,
164166 B : backend:: LocalBackend < Block > + ' static ,
165167{
166- let call_executor = LocalCallExecutor :: new ( backend. clone ( ) , executor) ;
168+ let call_executor = LocalCallExecutor :: new ( backend. clone ( ) , executor, spawn_handle ) ;
167169 let extensions = ExecutionExtensions :: new ( Default :: default ( ) , keystore) ;
168170 Client :: new (
169171 backend,
@@ -1124,7 +1126,13 @@ impl<B, E, Block, RA> ProofProvider<Block> for Client<B, E, Block, RA> where
11241126
11251127 let state = self . state_at ( id) ?;
11261128 let header = self . prepare_environment_block ( id) ?;
1127- prove_execution ( state, header, & self . executor , method, call_data) . map ( |( r, p) | {
1129+ prove_execution (
1130+ state,
1131+ header,
1132+ & self . executor ,
1133+ method,
1134+ call_data,
1135+ ) . map ( |( r, p) | {
11281136 ( r, StorageProof :: merge ( vec ! [ p, code_proof] ) )
11291137 } )
11301138 }
@@ -3482,6 +3490,7 @@ pub(crate) mod tests {
34823490 & substrate_test_runtime_client:: GenesisParameters :: default ( ) . genesis_storage ( ) ,
34833491 None ,
34843492 None ,
3493+ sp_core:: tasks:: executor ( ) ,
34853494 )
34863495 . unwrap ( ) ;
34873496
0 commit comments