refactor(sc-executor): use wasm executor builder instead of old apis (#13740)

* refactor: use builder api for all executors

* improve a lot

* remove unused args

* cleanup deps

* fix inconsistency about heap alloc

* add `heap_pages` back to try-runtime

* fix

* chore: reduce duplicated code for sc-service-test

* cleanup code

* fmt

* improve test executor

* improve

* use #[deprecated]

* set runtime_cache_size: 4

* fix and improve

* refactor builder

* fix

* fix bench

* fix tests

* fix warnings

* fix warnings

* fix

* fix

* update by suggestions

* update name
This commit is contained in:
yjh
2023-04-10 07:48:40 +08:00
committed by GitHub
parent f4d079a723
commit d5e460b3bf
29 changed files with 212 additions and 209 deletions
+3 -5
View File
@@ -65,9 +65,7 @@ impl<G, E, F, U> Drop for TestNet<G, E, F, U> {
}
}
pub trait TestNetNode:
Clone + Future<Output = Result<(), sc_service::Error>> + Send + 'static
{
pub trait TestNetNode: Clone + Future<Output = Result<(), Error>> + Send + 'static {
type Block: BlockT;
type Backend: Backend<Self::Block>;
type Executor: CallExecutor<Self::Block> + Send + Sync;
@@ -128,7 +126,7 @@ impl<TBl: BlockT, TBackend, TExec, TRtApi, TExPool> Clone
impl<TBl: BlockT, TBackend, TExec, TRtApi, TExPool> Future
for TestNetComponents<TBl, TBackend, TExec, TRtApi, TExPool>
{
type Output = Result<(), sc_service::Error>;
type Output = Result<(), Error>;
fn poll(self: Pin<&mut Self>, cx: &mut Context) -> Poll<Self::Output> {
Pin::new(&mut self.task_manager.lock().future()).poll(cx)
@@ -248,7 +246,7 @@ fn node_config<
state_pruning: Default::default(),
blocks_pruning: BlocksPruning::KeepFinalized,
chain_spec: Box::new((*spec).clone()),
wasm_method: sc_service::config::WasmExecutionMethod::Interpreted,
wasm_method: Default::default(),
wasm_runtime_overrides: Default::default(),
execution_strategies: Default::default(),
rpc_http: None,