Update substrate

This commit is contained in:
Luke Parker
2023-07-18 22:30:55 -04:00
parent a7c9c1ef55
commit 64402914ba
23 changed files with 881 additions and 798 deletions

View File

@@ -4,7 +4,7 @@ use serai_runtime::Block;
use sc_service::{PruningMode, PartialComponents};
use sc_cli::{ChainSpec, RuntimeVersion, SubstrateCli};
use sc_cli::SubstrateCli;
use frame_benchmarking_cli::{ExtrinsicFactory, BenchmarkCmd, SUBSTRATE_REFERENCE_HARDWARE};
use crate::{
@@ -46,10 +46,6 @@ impl SubstrateCli for Cli {
_ => panic!("Unknown network ID"),
}
}
fn native_runtime_version(_: &Box<dyn ChainSpec>) -> &'static RuntimeVersion {
&serai_runtime::VERSION
}
}
pub fn run() -> sc_cli::Result<()> {
@@ -99,29 +95,7 @@ pub fn run() -> sc_cli::Result<()> {
}),
Some(Subcommand::Benchmark(cmd)) => cli.create_runner(cmd)?.sync_run(|config| match cmd {
BenchmarkCmd::Pallet(cmd) => {
use sc_executor::{NativeVersion, NativeExecutionDispatch};
use serai_runtime as runtime;
struct ExecutorDispatch;
impl NativeExecutionDispatch for ExecutorDispatch {
#[cfg(feature = "runtime-benchmarks")]
type ExtendHostFunctions = frame_benchmarking::benchmarking::HostFunctions;
#[cfg(not(feature = "runtime-benchmarks"))]
type ExtendHostFunctions = ();
fn dispatch(method: &str, data: &[u8]) -> Option<Vec<u8>> {
runtime::api::dispatch(method, data)
}
fn native_version() -> NativeVersion {
runtime::native_version()
}
}
cmd.run::<Block, ExecutorDispatch>(config)
}
BenchmarkCmd::Pallet(cmd) => cmd.run::<Block, ()>(config),
BenchmarkCmd::Block(cmd) => cmd.run(service::new_partial(&config)?.client),