mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 17:28:00 +00:00
Adds new execution strategy nativeElseWasm (#1546)
* fix: adds new execution strategy nativeElseWasm and replace nativeWhenPossible with it * feat: adds cmd line params for execution strategies * fix: uses of cmd line execution strategies * chore: remove white spaces * chore: remove println * chore: remove whitespace * fix: generating functions with context * feat: add function to generate with_context declarations * fix: add implementation for with_context function calls * fix: add execution context to call_api_at function * fix: making use of context to select strategy for block_builder * chore: cleaning up * fix: merging issues * fix tests * add wasm files * chore: small doc for context fields * chore: delete redundant docs * fix: use full path for ExecutionContext * fix: add context functions from inside fold_item_impl * chore: remove clone * fix: moving generative function to utils, remove unused imports * fix: add missing full path for ExecutionContext * fix: merge issues * update wasm files * fix: update to keep up with changes in master * chore: remove unused functions, clean up * fix test * fix grumbles * fix: add more tests * fix: some refactorings * feat: add execution strategy to call * chore: small improvements * fix: add message to panic * fix tests
This commit is contained in:
@@ -25,6 +25,7 @@ mod params;
|
||||
pub mod error;
|
||||
pub mod informant;
|
||||
|
||||
use client::ExecutionStrategies;
|
||||
use runtime_primitives::traits::As;
|
||||
use service::{
|
||||
ServiceFactory, FactoryFullConfiguration, RuntimeGenesis,
|
||||
@@ -351,17 +352,19 @@ where
|
||||
|
||||
let role =
|
||||
if cli.light {
|
||||
config.block_execution_strategy = service::ExecutionStrategy::NativeWhenPossible;
|
||||
service::Roles::LIGHT
|
||||
} else if cli.validator || cli.shared_params.dev {
|
||||
config.block_execution_strategy = service::ExecutionStrategy::Both;
|
||||
service::Roles::AUTHORITY
|
||||
} else {
|
||||
config.block_execution_strategy = service::ExecutionStrategy::NativeWhenPossible;
|
||||
service::Roles::FULL
|
||||
};
|
||||
|
||||
config.block_execution_strategy = cli.execution.into();
|
||||
config.execution_strategies = ExecutionStrategies {
|
||||
syncing: cli.syncing_execution.into(),
|
||||
importing: cli.importing_execution.into(),
|
||||
block_construction: cli.block_construction_execution.into(),
|
||||
other: cli.other_execution.into(),
|
||||
};
|
||||
|
||||
config.roles = role;
|
||||
let client_id = config.client_id();
|
||||
@@ -536,10 +539,7 @@ where
|
||||
E: IntoExit,
|
||||
S: FnOnce(&str) -> Result<Option<ChainSpec<FactoryGenesis<F>>>, String>,
|
||||
{
|
||||
let mut config = create_config_with_db_path::<F, _>(spec_factory, &cli.shared_params, version)?;
|
||||
|
||||
config.block_execution_strategy = cli.execution.into();
|
||||
config.api_execution_strategy = cli.api_execution.into();
|
||||
let config = create_config_with_db_path::<F, _>(spec_factory, &cli.shared_params, version)?;
|
||||
|
||||
let file: Box<Read> = match cli.input {
|
||||
Some(filename) => Box::new(File::open(filename)?),
|
||||
|
||||
Reference in New Issue
Block a user