mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 20:29:23 +00:00
Update substrate
This commit is contained in:
@@ -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),
|
||||
|
||||
|
||||
Reference in New Issue
Block a user