diff --git a/substrate/node/src/command_helper.rs b/substrate/node/src/command_helper.rs index 01c9bb38..500a7080 100644 --- a/substrate/node/src/command_helper.rs +++ b/substrate/node/src/command_helper.rs @@ -66,24 +66,22 @@ pub fn create_benchmark_extrinsic( runtime::UncheckedExtrinsic::new_signed( call.clone(), - sp_runtime::AccountId32::from(sender.public()).into(), - runtime::Signature::Sr25519( - runtime::SignedPayload::from_raw( - call, - extra.clone(), - ( - (), - runtime::VERSION.spec_version, - runtime::VERSION.transaction_version, - client.block_hash(0).ok().flatten().unwrap(), - client.chain_info().best_hash, - (), - (), - (), - ), - ) - .using_encoded(|e| sender.sign(e)), - ), + sender.public(), + runtime::SignedPayload::from_raw( + call, + extra.clone(), + ( + (), + runtime::VERSION.spec_version, + runtime::VERSION.transaction_version, + client.block_hash(0).ok().flatten().unwrap(), + client.chain_info().best_hash, + (), + (), + (), + ), + ) + .using_encoded(|e| sender.sign(e)), extra, ) } diff --git a/substrate/runtime/src/lib.rs b/substrate/runtime/src/lib.rs index 1c9d0635..3a411192 100644 --- a/substrate/runtime/src/lib.rs +++ b/substrate/runtime/src/lib.rs @@ -8,7 +8,7 @@ use sp_core::{crypto::KeyTypeId, OpaqueMetadata}; pub use sp_core::sr25519::Signature; use sp_runtime::{ create_runtime_str, generic, impl_opaque_keys, - traits::{AccountIdLookup, BlakeTwo256, Block as BlockT, IdentifyAccount, Verify}, + traits::{IdentityLookup, BlakeTwo256, Block as BlockT}, transaction_validity::{TransactionSource, TransactionValidity}, ApplyExtrinsicResult, Perbill, }; @@ -35,9 +35,11 @@ use pallet_transaction_payment::CurrencyAdapter; /// An index to a block. pub type BlockNumber = u32; -/// Some way of identifying an account on the chain. We intentionally make it equivalent -/// to the public key of our transaction signing scheme. -pub type AccountId = <::Signer as IdentifyAccount>::AccountId; +/// Signature type +pub type Signature = sp_core::sr25519::Signature; + +/// Account ID type, equivalent to a public key +pub type AccountId = sp_core::sr25519::Public; /// Balance of an account. pub type Balance = u64; @@ -101,7 +103,7 @@ parameter_types! { pub const BlockHashCount: BlockNumber = 2400; pub const Version: RuntimeVersion = VERSION; - pub const SS58Prefix: u8 = 42; // TODO: Remove + pub const SS58Prefix: u8 = 42; // TODO: Remove for Bech32m // 1 MB block size limit pub BlockLength: frame_system::limits::BlockLength = @@ -130,7 +132,7 @@ impl frame_system::Config for Runtime { type BlockLength = BlockLength; type AccountId = AccountId; type RuntimeCall = RuntimeCall; - type Lookup = AccountIdLookup; + type Lookup = IdentityLookup; type Index = Index; type BlockNumber = BlockNumber; type Hash = Hash; @@ -149,7 +151,7 @@ impl frame_system::Config for Runtime { type AccountData = pallet_balances::AccountData; type SystemWeightInfo = (); - type SS58Prefix = SS58Prefix; // TODO: Remove + type SS58Prefix = SS58Prefix; // TODO: Remove for Bech32m type MaxConsumers = frame_support::traits::ConstU32<16>; } @@ -191,12 +193,6 @@ impl pallet_contracts::Config for Runtime { type RuntimeEvent = RuntimeEvent; type RuntimeCall = RuntimeCall; - /// The safest default is to allow no calls at all. - /// - /// Runtimes should whitelist dispatchables that are allowed to be called from contracts - /// and make sure they are stable. Dispatchables exposed to contracts are not allowed to - /// change because that would break already deployed contracts. The `Call` structure itself - /// is not allowed to change the indices of existing pallets, too. type CallFilter = frame_support::traits::Nothing; type DepositPerItem = DepositPerItem; type DepositPerByte = DepositPerByte; @@ -213,7 +209,7 @@ impl pallet_contracts::Config for Runtime { type MaxStorageKeyLen = ConstU32<128>; } -pub type Address = sp_runtime::MultiAddress; +pub type Address = AccountId; pub type Header = generic::Header; pub type Block = generic::Block; pub type SignedExtra = (