mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 22:11:06 +00:00
Companion PR for 'Make choosing an executor an explicit part of service construction' (#9525) (#3615)
* Companion PR * Update a few files * Run cargo fmt * Do better at renaming things * More renamings * More fixes * oops * Fix simnet problems * fix compilation * Update substrate Co-authored-by: thiolliere <gui.thiolliere@gmail.com>
This commit is contained in:
@@ -27,6 +27,7 @@ use polkadot_runtime::{
|
||||
use polkadot_runtime_common::claims;
|
||||
use sc_consensus_babe::BabeBlockImport;
|
||||
use sc_consensus_manual_seal::consensus::babe::SlotTimestampProvider;
|
||||
use sc_executor::NativeElseWasmExecutor;
|
||||
use sc_service::{TFullBackend, TFullClient};
|
||||
use sp_runtime::{app_crypto::sp_core::H256, generic::Era, AccountId32};
|
||||
use std::{error::Error, future::Future, str::FromStr};
|
||||
@@ -40,11 +41,11 @@ type BlockImport<B, BE, C, SC> = BabeBlockImport<B, C, GrandpaBlockImport<BE, B,
|
||||
type Block = polkadot_primitives::v1::Block;
|
||||
type SelectChain = sc_consensus::LongestChain<TFullBackend<Block>, Block>;
|
||||
|
||||
/// Declare an instance of the native executor named `Executor`. Include the wasm binary as the
|
||||
/// Declare an instance of the native executor named `ExecutorDispatch`. Include the wasm binary as the
|
||||
/// equivalent wasm code.
|
||||
pub struct Executor;
|
||||
pub struct ExecutorDispatch;
|
||||
|
||||
impl sc_executor::NativeExecutionDispatch for Executor {
|
||||
impl sc_executor::NativeExecutionDispatch for ExecutorDispatch {
|
||||
type ExtendHostFunctions =
|
||||
(benchmarking::benchmarking::HostFunctions, SignatureVerificationOverride);
|
||||
|
||||
@@ -62,14 +63,14 @@ pub struct PolkadotChainInfo;
|
||||
|
||||
impl ChainInfo for PolkadotChainInfo {
|
||||
type Block = Block;
|
||||
type Executor = Executor;
|
||||
type ExecutorDispatch = ExecutorDispatch;
|
||||
type Runtime = Runtime;
|
||||
type RuntimeApi = RuntimeApi;
|
||||
type SelectChain = SelectChain;
|
||||
type BlockImport = BlockImport<
|
||||
Self::Block,
|
||||
TFullBackend<Self::Block>,
|
||||
TFullClient<Self::Block, RuntimeApi, Self::Executor>,
|
||||
TFullClient<Self::Block, RuntimeApi, NativeElseWasmExecutor<ExecutorDispatch>>,
|
||||
Self::SelectChain,
|
||||
>;
|
||||
type SignedExtras = polkadot_runtime::SignedExtra;
|
||||
@@ -98,14 +99,14 @@ pub async fn dispatch_with_root<T>(
|
||||
where
|
||||
T: ChainInfo<
|
||||
Block = Block,
|
||||
Executor = Executor,
|
||||
ExecutorDispatch = ExecutorDispatch,
|
||||
Runtime = Runtime,
|
||||
RuntimeApi = RuntimeApi,
|
||||
SelectChain = SelectChain,
|
||||
BlockImport = BlockImport<
|
||||
Block,
|
||||
TFullBackend<Block>,
|
||||
TFullClient<Block, RuntimeApi, Executor>,
|
||||
TFullClient<Block, RuntimeApi, NativeElseWasmExecutor<ExecutorDispatch>>,
|
||||
SelectChain,
|
||||
>,
|
||||
SignedExtras = polkadot_runtime::SignedExtra,
|
||||
|
||||
Reference in New Issue
Block a user