From be1c132a4eb7870af2b9a79feab0f2bccf4f51dd Mon Sep 17 00:00:00 2001 From: johnreedv Date: Thu, 7 Nov 2024 13:31:40 -0800 Subject: [PATCH] fmt --- runtime/src/lib.rs | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index 0bbb1933f..a38574077 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -38,7 +38,6 @@ use sp_core::{ crypto::{ByteArray, KeyTypeId}, OpaqueMetadata, H160, H256, U256, }; -use sp_runtime::generic::Era; use sp_runtime::{ create_runtime_str, generic, impl_opaque_keys, traits::{ @@ -53,6 +52,7 @@ use sp_std::prelude::*; #[cfg(feature = "std")] use sp_version::NativeVersion; use sp_version::RuntimeVersion; +use sp_runtime::generic::Era; // A few exports that help ease life for downstream crates. pub use frame_support::{ @@ -90,12 +90,12 @@ use pallet_evm::{Account as EVMAccount, BalanceConverter, FeeCalculator, Runner} // Drand impl pallet_drand::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type WeightInfo = pallet_drand::weights::SubstrateWeight; - type AuthorityId = pallet_drand::crypto::TestAuthId; - type Verifier = pallet_drand::QuicknetVerifier; - type UnsignedPriority = ConstU64<{ 1 << 20 }>; - type HttpFetchTimeout = ConstU64<1_000>; + type RuntimeEvent = RuntimeEvent; + type WeightInfo = pallet_drand::weights::SubstrateWeight; + type AuthorityId = pallet_drand::crypto::TestAuthId; + type Verifier = pallet_drand::QuicknetVerifier; + type UnsignedPriority = ConstU64<{ 1 << 20 }>; + type HttpFetchTimeout = ConstU64<1_000>; } impl frame_system::offchain::SigningTypes for Runtime { @@ -112,8 +112,10 @@ where } impl frame_system::offchain::CreateSignedTransaction> for Runtime { - fn create_transaction>( - call: RuntimeCall, // Change parameter type to `RuntimeCall` + fn create_transaction< + S: frame_system::offchain::AppCrypto, + >( + call: RuntimeCall, public: ::Signer, account: AccountId, index: Index, @@ -123,8 +125,6 @@ impl frame_system::offchain::CreateSignedTransaction )> { use sp_runtime::traits::StaticLookup; - // No need to convert `call` since it's already `RuntimeCall` - let address = ::Lookup::unlookup(account.clone()); let extra: SignedExtra = ( frame_system::CheckNonZeroSender::::new(), @@ -143,7 +143,11 @@ impl frame_system::offchain::CreateSignedTransaction let raw_payload = SignedPayload::new(call.clone(), extra.clone()).ok()?; let signature = raw_payload.using_encoded(|payload| S::sign(payload, public))?; - let signature_payload = (address, signature.into(), extra); + let signature_payload = ( + address, + signature.into(), + extra, + ); Some((call, signature_payload)) }