mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 17:28:00 +00:00
Make light client backend only work with locally available data (#3538)
* removing fetcher dependency from light backend * fix compilation
This commit is contained in:
committed by
Gavin Wood
parent
fd924c07ed
commit
634ca73e50
@@ -73,20 +73,11 @@ pub type Executor = client::LocalCallExecutor<
|
||||
pub type LightBackend = generic_test_client::LightBackend<runtime::Block>;
|
||||
|
||||
/// Test client light executor.
|
||||
pub type LightExecutor = client::light::call_executor::RemoteOrLocalCallExecutor<
|
||||
runtime::Block,
|
||||
pub type LightExecutor = client::light::call_executor::GenesisCallExecutor<
|
||||
LightBackend,
|
||||
client::light::call_executor::RemoteCallExecutor<
|
||||
client::light::blockchain::Blockchain<
|
||||
client_db::light::LightStorage<runtime::Block>,
|
||||
LightFetcher
|
||||
>,
|
||||
LightFetcher
|
||||
>,
|
||||
client::LocalCallExecutor<
|
||||
client::light::backend::Backend<
|
||||
client_db::light::LightStorage<runtime::Block>,
|
||||
LightFetcher,
|
||||
Blake2Hasher
|
||||
>,
|
||||
NativeExecutor<LocalExecutor>
|
||||
@@ -271,22 +262,16 @@ pub fn new_light() -> (
|
||||
let blockchain = Arc::new(client::light::blockchain::Blockchain::new(storage));
|
||||
let backend = Arc::new(LightBackend::new(blockchain.clone()));
|
||||
let executor = NativeExecutor::new(None);
|
||||
let fetcher = Arc::new(LightFetcher);
|
||||
let remote_call_executor = client::light::call_executor::RemoteCallExecutor::new(
|
||||
blockchain.clone(),
|
||||
fetcher,
|
||||
);
|
||||
let local_call_executor = client::LocalCallExecutor::new(backend.clone(), executor, None);
|
||||
let call_executor = LightExecutor::new(
|
||||
backend.clone(),
|
||||
remote_call_executor,
|
||||
local_call_executor,
|
||||
);
|
||||
|
||||
(TestClientBuilder::with_backend(backend.clone())
|
||||
.build_with_executor(call_executor)
|
||||
.0,
|
||||
backend,
|
||||
(
|
||||
TestClientBuilder::with_backend(backend.clone())
|
||||
.build_with_executor(call_executor)
|
||||
.0,
|
||||
backend,
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user