Skip to content
Snippets Groups Projects
Unverified Commit a073176e authored by bgallois's avatar bgallois
Browse files

remove unused type

parent a6efc7b6
Branches
Tags
No related merge requests found
Pipeline #36517 passed
...@@ -51,14 +51,7 @@ macro_rules! unwrap_client { ...@@ -51,14 +51,7 @@ macro_rules! unwrap_client {
$code:expr $code:expr
) => { ) => {
match $client.as_ref() { match $client.as_ref() {
#[cfg(feature = "g1")] crate::service::client::Client::Client($client) => $code,
crate::service::client::Client::G1($client) => $code,
#[cfg(feature = "gtest")]
crate::service::client::Client::GTest($client) => $code,
#[cfg(feature = "gdev")]
crate::service::client::Client::GDev($client) => $code,
#[allow(unreachable_patterns)]
_ => panic!("unknown runtime"),
} }
}; };
} }
......
...@@ -294,23 +294,28 @@ trait BenchmarkCallSigner<RuntimeCall: Encode + Clone, Signer: Pair> { ...@@ -294,23 +294,28 @@ trait BenchmarkCallSigner<RuntimeCall: Encode + Clone, Signer: Pair> {
} }
#[cfg(feature = "g1")] #[cfg(feature = "g1")]
use g1_runtime as runtime; type FullClient = super::FullClient<
#[cfg(feature = "g1")] super::runtime_executor::runtime::RuntimeApi,
type FullClient = super::FullClient<runtime::RuntimeApi, super::runtime_executor::Executor>; super::runtime_executor::Executor,
#[cfg(feature = "gdev")] >;
use gdev_runtime as runtime;
#[cfg(feature = "gdev")] #[cfg(feature = "gdev")]
type FullClient = super::FullClient<runtime::RuntimeApi, super::runtime_executor::Executor>; type FullClient = super::FullClient<
#[cfg(feature = "gtest")] super::runtime_executor::runtime::RuntimeApi,
use gtest_runtime as runtime; super::runtime_executor::Executor,
>;
#[cfg(feature = "gtest")] #[cfg(feature = "gtest")]
type FullClient = super::FullClient<runtime::RuntimeApi, super::runtime_executor::Executor>; type FullClient = super::FullClient<
super::runtime_executor::runtime::RuntimeApi,
super::runtime_executor::Executor,
>;
#[cfg(any(feature = "gdev", feature = "gtest", feature = "g1"))] #[cfg(any(feature = "gdev", feature = "gtest", feature = "g1"))]
impl BenchmarkCallSigner<runtime::RuntimeCall, sp_core::sr25519::Pair> for FullClient { impl BenchmarkCallSigner<super::runtime_executor::runtime::RuntimeCall, sp_core::sr25519::Pair>
for FullClient
{
fn sign_call( fn sign_call(
&self, &self,
call: runtime::RuntimeCall, call: super::runtime_executor::runtime::RuntimeCall,
nonce: u32, nonce: u32,
current_block: u64, current_block: u64,
period: u64, period: u64,
...@@ -319,17 +324,20 @@ impl BenchmarkCallSigner<runtime::RuntimeCall, sp_core::sr25519::Pair> for FullC ...@@ -319,17 +324,20 @@ impl BenchmarkCallSigner<runtime::RuntimeCall, sp_core::sr25519::Pair> for FullC
) -> sp_runtime::OpaqueExtrinsic { ) -> sp_runtime::OpaqueExtrinsic {
// use runtime; // use runtime;
let extra: runtime::SignedExtra = ( let extra: super::runtime_executor::runtime::SignedExtra = (
frame_system::CheckNonZeroSender::<runtime::Runtime>::new(), frame_system::CheckNonZeroSender::<super::runtime_executor::runtime::Runtime>::new(),
frame_system::CheckSpecVersion::<runtime::Runtime>::new(), frame_system::CheckSpecVersion::<super::runtime_executor::runtime::Runtime>::new(),
frame_system::CheckTxVersion::<runtime::Runtime>::new(), frame_system::CheckTxVersion::<super::runtime_executor::runtime::Runtime>::new(),
frame_system::CheckGenesis::<runtime::Runtime>::new(), frame_system::CheckGenesis::<super::runtime_executor::runtime::Runtime>::new(),
frame_system::CheckMortality::<runtime::Runtime>::from( frame_system::CheckMortality::<super::runtime_executor::runtime::Runtime>::from(
sp_runtime::generic::Era::mortal(period, current_block), sp_runtime::generic::Era::mortal(period, current_block),
), ),
frame_system::CheckNonce::<runtime::Runtime>::from(nonce).into(), frame_system::CheckNonce::<super::runtime_executor::runtime::Runtime>::from(nonce)
frame_system::CheckWeight::<runtime::Runtime>::new(), .into(),
pallet_transaction_payment::ChargeTransactionPayment::<runtime::Runtime>::from(0), frame_system::CheckWeight::<super::runtime_executor::runtime::Runtime>::new(),
pallet_transaction_payment::ChargeTransactionPayment::<
super::runtime_executor::runtime::Runtime,
>::from(0),
); );
let payload = sp_runtime::generic::SignedPayload::from_raw( let payload = sp_runtime::generic::SignedPayload::from_raw(
...@@ -337,8 +345,8 @@ impl BenchmarkCallSigner<runtime::RuntimeCall, sp_core::sr25519::Pair> for FullC ...@@ -337,8 +345,8 @@ impl BenchmarkCallSigner<runtime::RuntimeCall, sp_core::sr25519::Pair> for FullC
extra.clone(), extra.clone(),
( (
(), (),
runtime::VERSION.spec_version, super::runtime_executor::runtime::VERSION.spec_version,
runtime::VERSION.transaction_version, super::runtime_executor::runtime::VERSION.transaction_version,
genesis, genesis,
genesis, genesis,
(), (),
...@@ -348,7 +356,7 @@ impl BenchmarkCallSigner<runtime::RuntimeCall, sp_core::sr25519::Pair> for FullC ...@@ -348,7 +356,7 @@ impl BenchmarkCallSigner<runtime::RuntimeCall, sp_core::sr25519::Pair> for FullC
); );
let signature = payload.using_encoded(|p| acc.sign(p)); let signature = payload.using_encoded(|p| acc.sign(p));
runtime::UncheckedExtrinsic::new_signed( super::runtime_executor::runtime::UncheckedExtrinsic::new_signed(
call, call,
sp_runtime::AccountId32::from(acc.public()).into(), sp_runtime::AccountId32::from(acc.public()).into(),
common_runtime::Signature::Sr25519(signature), common_runtime::Signature::Sr25519(signature),
...@@ -370,10 +378,10 @@ impl frame_benchmarking_cli::ExtrinsicBuilder for Client { ...@@ -370,10 +378,10 @@ impl frame_benchmarking_cli::ExtrinsicBuilder for Client {
fn build(&self, nonce: u32) -> std::result::Result<sp_runtime::OpaqueExtrinsic, &'static str> { fn build(&self, nonce: u32) -> std::result::Result<sp_runtime::OpaqueExtrinsic, &'static str> {
with_client! { with_client! {
self, client, { self, client, {
let call = runtime::RuntimeCall::System(runtime::SystemCall::remark { remark: vec![] }); let call = super::runtime_executor::runtime::RuntimeCall::System(super::runtime_executor::runtime::SystemCall::remark { remark: vec![] });
let signer = sp_keyring::Sr25519Keyring::Bob.pair(); let signer = sp_keyring::Sr25519Keyring::Bob.pair();
let period = runtime::BlockHashCount::get().checked_next_power_of_two().map(|c| c / 2).unwrap_or(2) as u64; let period = super::runtime_executor::runtime::BlockHashCount::get().checked_next_power_of_two().map(|c| c / 2).unwrap_or(2) as u64;
let genesis = client.usage_info().chain.best_hash; let genesis = client.usage_info().chain.best_hash;
Ok(client.sign_call(call, nonce, 0, period, genesis, signer)) Ok(client.sign_call(call, nonce, 0, period, genesis, signer))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment