From b42011f0a0be2bbe3c389ef2c3e8b5bf77596c00 Mon Sep 17 00:00:00 2001 From: Juan Girini Date: Wed, 24 May 2023 14:35:10 +0200 Subject: [PATCH 01/11] replace Index by Nonce --- frame/system/src/extensions/check_nonce.rs | 6 +++--- frame/system/src/lib.rs | 13 ++++++------- frame/system/src/offchain.rs | 2 +- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/frame/system/src/extensions/check_nonce.rs b/frame/system/src/extensions/check_nonce.rs index 57ebd7701ef6a..2939fd6534c09 100644 --- a/frame/system/src/extensions/check_nonce.rs +++ b/frame/system/src/extensions/check_nonce.rs @@ -37,11 +37,11 @@ use sp_std::vec; /// some kind of priority upon validating transactions. #[derive(Encode, Decode, Clone, Eq, PartialEq, TypeInfo)] #[scale_info(skip_type_params(T))] -pub struct CheckNonce(#[codec(compact)] pub T::Index); +pub struct CheckNonce(#[codec(compact)] pub T::Nonce); impl CheckNonce { /// utility constructor. Used only in client/factory code. - pub fn from(nonce: T::Index) -> Self { + pub fn from(nonce: T::Nonce) -> Self { Self(nonce) } } @@ -88,7 +88,7 @@ where } .into()) } - account.nonce += T::Index::one(); + account.nonce += T::Nonce::one(); crate::Account::::insert(who, account); Ok(()) } diff --git a/frame/system/src/lib.rs b/frame/system/src/lib.rs index f3d75f719d54c..28cdf62f1442e 100644 --- a/frame/system/src/lib.rs +++ b/frame/system/src/lib.rs @@ -229,9 +229,8 @@ pub mod pallet { + Debug + From>; - /// Account index (aka nonce) type. This stores the number of previous transactions - /// associated with a sender account. - type Index: Parameter + /// This stores the number of previous transactions associated with a sender account. + type Nonce: Parameter + Member + MaybeSerializeDeserialize + Debug @@ -528,7 +527,7 @@ pub mod pallet { _, Blake2_128Concat, T::AccountId, - AccountInfo, + AccountInfo, ValueQuery, >; @@ -1533,13 +1532,13 @@ impl Pallet { } /// Retrieve the account transaction counter from storage. - pub fn account_nonce(who: impl EncodeLike) -> T::Index { + pub fn account_nonce(who: impl EncodeLike) -> T::Nonce { Account::::get(who).nonce } /// Increment a particular account's nonce by 1. pub fn inc_account_nonce(who: impl EncodeLike) { - Account::::mutate(who, |a| a.nonce += T::Index::one()); + Account::::mutate(who, |a| a.nonce += T::Nonce::one()); } /// Note what the extrinsic data of the current extrinsic index is. @@ -1595,7 +1594,7 @@ impl Pallet { } /// An account is being created. - pub fn on_created_account(who: T::AccountId, _a: &mut AccountInfo) { + pub fn on_created_account(who: T::AccountId, _a: &mut AccountInfo) { T::OnNewAccount::on_new_account(&who); Self::deposit_event(Event::NewAccount { account: who }); } diff --git a/frame/system/src/offchain.rs b/frame/system/src/offchain.rs index 742146d1642c8..313a557c44d76 100644 --- a/frame/system/src/offchain.rs +++ b/frame/system/src/offchain.rs @@ -486,7 +486,7 @@ pub trait CreateSignedTransaction: call: Self::OverarchingCall, public: Self::Public, account: Self::AccountId, - nonce: Self::Index, + nonce: Self::Nonce, ) -> Option<(Self::OverarchingCall, ::SignaturePayload)>; } From 04b7a391c962a37b3c2caecfe6972110904aa733 Mon Sep 17 00:00:00 2001 From: Juan Girini Date: Wed, 24 May 2023 15:08:18 +0200 Subject: [PATCH 02/11] replace Index by Nonce --- frame/system/src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frame/system/src/lib.rs b/frame/system/src/lib.rs index 28cdf62f1442e..c400b854508b4 100644 --- a/frame/system/src/lib.rs +++ b/frame/system/src/lib.rs @@ -50,7 +50,7 @@ //! - [`CheckWeight`]: Checks the weight and length of the block and ensure that it does not //! exceed the limits. //! - [`CheckNonce`]: Checks the nonce of the transaction. Contains a single payload of type -//! `T::Index`. +//! `T::Nonce`. //! - [`CheckEra`]: Checks the era of the transaction. Contains a single payload of type `Era`. //! - [`CheckGenesis`]: Checks the provided genesis hash of the transaction. Must be a part of the //! signed payload of the transaction. @@ -724,9 +724,9 @@ pub type RefCount = u32; /// Information of an account. #[derive(Clone, Eq, PartialEq, Default, RuntimeDebug, Encode, Decode, TypeInfo, MaxEncodedLen)] -pub struct AccountInfo { +pub struct AccountInfo { /// The number of transactions this account has sent. - pub nonce: Index, + pub nonce: Nonce, /// The number of other modules that currently depend on this account's existence. The account /// cannot be reaped until this is zero. pub consumers: RefCount, From 1dd5e6a4b1fe3168fdd6f975e611808f182d191c Mon Sep 17 00:00:00 2001 From: Juan Girini Date: Wed, 24 May 2023 15:27:56 +0200 Subject: [PATCH 03/11] replace Index by Nonce --- frame/system/README.md | 2 +- frame/system/benches/bench.rs | 2 +- frame/system/rpc/runtime-api/src/lib.rs | 8 ++++---- frame/system/src/migrations/mod.rs | 4 ++-- frame/system/src/mock.rs | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/frame/system/README.md b/frame/system/README.md index c22b41e42d798..30b2ea73720cf 100644 --- a/frame/system/README.md +++ b/frame/system/README.md @@ -33,7 +33,7 @@ The System module defines the following extensions: - [`CheckWeight`]: Checks the weight and length of the block and ensure that it does not exceed the limits. - [`CheckNonce`]: Checks the nonce of the transaction. Contains a single payload of type - `T::Index`. + `T::Nonce`. - [`CheckEra`]: Checks the era of the transaction. Contains a single payload of type `Era`. - [`CheckGenesis`]: Checks the provided genesis hash of the transaction. Must be a part of the signed payload of the transaction. diff --git a/frame/system/benches/bench.rs b/frame/system/benches/bench.rs index e2fed3e51855d..809eb4820b9a3 100644 --- a/frame/system/benches/bench.rs +++ b/frame/system/benches/bench.rs @@ -69,7 +69,7 @@ impl frame_system::Config for Runtime { type BlockLength = BlockLength; type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; - type Index = u64; + type Nonce = u64; type BlockNumber = u64; type RuntimeCall = RuntimeCall; type Hash = H256; diff --git a/frame/system/rpc/runtime-api/src/lib.rs b/frame/system/rpc/runtime-api/src/lib.rs index 2ea9f2f62e11c..f59988d818f07 100644 --- a/frame/system/rpc/runtime-api/src/lib.rs +++ b/frame/system/rpc/runtime-api/src/lib.rs @@ -24,12 +24,12 @@ #![cfg_attr(not(feature = "std"), no_std)] sp_api::decl_runtime_apis! { - /// The API to query account nonce (aka transaction index). - pub trait AccountNonceApi where + /// The API to query account nonce. + pub trait AccountNonceApi where AccountId: codec::Codec, - Index: codec::Codec, + Nonce: codec::Codec, { /// Get current account nonce of given `AccountId`. - fn account_nonce(account: AccountId) -> Index; + fn account_nonce(account: AccountId) -> Nonce; } } diff --git a/frame/system/src/migrations/mod.rs b/frame/system/src/migrations/mod.rs index f8ebfab33b891..07eef3d6c5ea7 100644 --- a/frame/system/src/migrations/mod.rs +++ b/frame/system/src/migrations/mod.rs @@ -31,8 +31,8 @@ type RefCount = u32; /// Information of an account. #[derive(Clone, Eq, PartialEq, Default, RuntimeDebug, Encode, Decode)] -struct AccountInfo { - nonce: Index, +struct AccountInfo { + nonce: Nonce, consumers: RefCount, providers: RefCount, sufficients: RefCount, diff --git a/frame/system/src/mock.rs b/frame/system/src/mock.rs index 83e12dccaa165..51e01a604e12f 100644 --- a/frame/system/src/mock.rs +++ b/frame/system/src/mock.rs @@ -96,7 +96,7 @@ impl Config for Test { type BlockLength = RuntimeBlockLength; type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; - type Index = u64; + type Nonce = u64; type BlockNumber = u64; type Hash = H256; type Hashing = BlakeTwo256; From 4b93fc7e78d39f683473be4043aedbd20bbd514f Mon Sep 17 00:00:00 2001 From: Juan Girini Date: Wed, 24 May 2023 15:45:06 +0200 Subject: [PATCH 04/11] replace Index by Nonce --- frame/system/benchmarking/src/mock.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frame/system/benchmarking/src/mock.rs b/frame/system/benchmarking/src/mock.rs index 8b05c5a8ba82a..fba4a2714c061 100644 --- a/frame/system/benchmarking/src/mock.rs +++ b/frame/system/benchmarking/src/mock.rs @@ -23,7 +23,7 @@ use codec::Encode; use sp_runtime::traits::IdentityLookup; type AccountId = u64; -type AccountIndex = u32; +type AccountNonce = u32; type BlockNumber = u64; type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; @@ -45,7 +45,7 @@ impl frame_system::Config for Test { type BlockLength = (); type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; - type Index = AccountIndex; + type Nonce = AccountNonce; type BlockNumber = BlockNumber; type RuntimeCall = RuntimeCall; type Hash = sp_core::H256; From 2becc48514ba7e59f42ffb4015dd82c912a3a377 Mon Sep 17 00:00:00 2001 From: Juan Girini Date: Wed, 24 May 2023 15:50:21 +0200 Subject: [PATCH 05/11] replace Index by Nonce --- frame/system/src/migrations/mod.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/frame/system/src/migrations/mod.rs b/frame/system/src/migrations/mod.rs index 07eef3d6c5ea7..acb7b636f216f 100644 --- a/frame/system/src/migrations/mod.rs +++ b/frame/system/src/migrations/mod.rs @@ -48,7 +48,7 @@ pub trait V2ToV3 { type AccountId: 'static + FullCodec; /// System config index - type Index: 'static + FullCodec + Copy; + type Nonce: 'static + FullCodec + Copy; /// System config account data type AccountData: 'static + FullCodec; @@ -65,13 +65,13 @@ type Account = StorageMap< Pallet, Blake2_128Concat, ::AccountId, - AccountInfo<::Index, ::AccountData>, + AccountInfo<::Nonce, ::AccountData>, >; /// Migrate from unique `u8` reference counting to triple `u32` reference counting. pub fn migrate_from_single_u8_to_triple_ref_count() -> Weight { let mut translated: usize = 0; - >::translate::<(V::Index, u8, V::AccountData), _>(|_key, (nonce, rc, data)| { + >::translate::<(V::Nonce, u8, V::AccountData), _>(|_key, (nonce, rc, data)| { translated += 1; Some(AccountInfo { nonce, consumers: rc as RefCount, providers: 1, sufficients: 0, data }) }); @@ -88,7 +88,7 @@ pub fn migrate_from_single_u8_to_triple_ref_count() -> Wei /// Migrate from unique `u32` reference counting to triple `u32` reference counting. pub fn migrate_from_single_to_triple_ref_count() -> Weight { let mut translated: usize = 0; - >::translate::<(V::Index, RefCount, V::AccountData), _>( + >::translate::<(V::Nonce, RefCount, V::AccountData), _>( |_key, (nonce, consumers, data)| { translated += 1; Some(AccountInfo { nonce, consumers, providers: 1, sufficients: 0, data }) @@ -106,7 +106,7 @@ pub fn migrate_from_single_to_triple_ref_count() -> Weight /// Migrate from dual `u32` reference counting to triple `u32` reference counting. pub fn migrate_from_dual_to_triple_ref_count() -> Weight { let mut translated: usize = 0; - >::translate::<(V::Index, RefCount, RefCount, V::AccountData), _>( + >::translate::<(V::Nonce, RefCount, RefCount, V::AccountData), _>( |_key, (nonce, consumers, providers, data)| { translated += 1; Some(AccountInfo { nonce, consumers, providers, sufficients: 0, data }) From 8488107b20964f6212a8e7d46931ea1a2dde4358 Mon Sep 17 00:00:00 2001 From: Juan Girini Date: Thu, 1 Jun 2023 10:30:23 +0200 Subject: [PATCH 06/11] wip --- frame/system/src/lib.rs | 10 ++++++++++ frame/system/src/migrations/mod.rs | 2 +- test-utils/runtime/src/lib.rs | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/frame/system/src/lib.rs b/frame/system/src/lib.rs index c400b854508b4..cdce897dcebce 100644 --- a/frame/system/src/lib.rs +++ b/frame/system/src/lib.rs @@ -240,6 +240,16 @@ pub mod pallet { + Copy + MaxEncodedLen; + type Index: Parameter + + Member + + MaybeSerializeDeserialize + + Debug + + Default + + MaybeDisplay + + AtLeast32Bit + + Copy + + MaxEncodedLen; + /// The block number type used by the runtime. type BlockNumber: Parameter + Member diff --git a/frame/system/src/migrations/mod.rs b/frame/system/src/migrations/mod.rs index acb7b636f216f..6f873061dbab9 100644 --- a/frame/system/src/migrations/mod.rs +++ b/frame/system/src/migrations/mod.rs @@ -47,7 +47,7 @@ pub trait V2ToV3 { /// System config account id type AccountId: 'static + FullCodec; - /// System config index + /// System config nonce type Nonce: 'static + FullCodec + Copy; /// System config account data diff --git a/test-utils/runtime/src/lib.rs b/test-utils/runtime/src/lib.rs index c93d5c4e5694b..ccb30614e0691 100644 --- a/test-utils/runtime/src/lib.rs +++ b/test-utils/runtime/src/lib.rs @@ -346,7 +346,7 @@ impl frame_system::pallet::Config for Runtime { type BlockLength = (); type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; - type Index = Index; + type Nonce = Index; type BlockNumber = BlockNumber; type Hash = H256; type Hashing = Hashing; From 29c5699a6639f9c8919ca5deae419b4b0e602094 Mon Sep 17 00:00:00 2001 From: Juan Girini Date: Fri, 2 Jun 2023 12:04:53 +0200 Subject: [PATCH 07/11] remove index in lieu of nonce --- bin/node-template/node/src/rpc.rs | 4 ++-- bin/node-template/pallets/template/src/mock.rs | 2 +- bin/node-template/runtime/src/lib.rs | 10 +++++----- bin/node/cli/benches/block_production.rs | 2 +- bin/node/executor/tests/basic.rs | 18 +++++++++--------- bin/node/executor/tests/fees.rs | 10 +++++----- bin/node/primitives/src/lib.rs | 2 +- bin/node/rpc/src/lib.rs | 4 ++-- bin/node/runtime/src/lib.rs | 10 +++++----- bin/node/testing/src/keyring.rs | 4 ++-- client/transaction-pool/tests/pool.rs | 8 ++++---- frame/alliance/src/mock.rs | 2 +- frame/asset-rate/src/mock.rs | 2 +- frame/assets/src/mock.rs | 2 +- frame/atomic-swap/src/tests.rs | 2 +- frame/aura/src/mock.rs | 2 +- frame/authority-discovery/src/lib.rs | 2 +- frame/authorship/src/lib.rs | 2 +- frame/babe/src/mock.rs | 2 +- frame/bags-list/src/mock.rs | 2 +- frame/balances/src/tests/mod.rs | 2 +- frame/beefy-mmr/src/mock.rs | 2 +- frame/beefy/src/mock.rs | 2 +- frame/benchmarking/pov/src/benchmarking.rs | 4 ++-- frame/benchmarking/pov/src/tests.rs | 2 +- frame/benchmarking/src/baseline.rs | 4 ++-- frame/benchmarking/src/tests.rs | 2 +- frame/benchmarking/src/tests_instance.rs | 2 +- frame/bounties/src/tests.rs | 2 +- frame/child-bounties/src/tests.rs | 2 +- frame/collective/src/tests.rs | 2 +- frame/contracts/src/tests.rs | 2 +- frame/conviction-voting/src/tests.rs | 2 +- frame/core-fellowship/src/tests.rs | 2 +- frame/democracy/src/tests.rs | 2 +- .../election-provider-multi-phase/src/mock.rs | 2 +- .../test-staking-e2e/src/mock.rs | 4 ++-- frame/election-provider-support/src/onchain.rs | 2 +- frame/elections-phragmen/src/lib.rs | 2 +- frame/examples/basic/src/tests.rs | 2 +- frame/examples/dev-mode/src/tests.rs | 2 +- frame/examples/offchain-worker/src/tests.rs | 2 +- frame/executive/src/lib.rs | 2 +- frame/fast-unstake/src/mock.rs | 4 ++-- frame/glutton/src/mock.rs | 2 +- frame/grandpa/src/mock.rs | 2 +- frame/identity/src/tests.rs | 2 +- frame/im-online/src/mock.rs | 2 +- frame/indices/src/mock.rs | 2 +- .../src/lib.rs | 2 +- frame/lottery/src/mock.rs | 2 +- frame/membership/src/lib.rs | 2 +- frame/merkle-mountain-range/src/mock.rs | 2 +- frame/message-queue/src/integration_test.rs | 2 +- frame/message-queue/src/mock.rs | 2 +- frame/multisig/src/tests.rs | 2 +- frame/nft-fractionalization/src/mock.rs | 2 +- frame/nfts/src/mock.rs | 2 +- frame/nicks/src/lib.rs | 2 +- frame/nis/src/mock.rs | 2 +- frame/node-authorization/src/mock.rs | 2 +- .../nomination-pools/benchmarking/src/mock.rs | 4 ++-- frame/nomination-pools/src/mock.rs | 2 +- .../nomination-pools/test-staking/src/mock.rs | 4 ++-- frame/offences/benchmarking/src/mock.rs | 4 ++-- frame/offences/src/mock.rs | 2 +- frame/preimage/src/mock.rs | 2 +- frame/proxy/src/tests.rs | 2 +- frame/ranked-collective/src/tests.rs | 2 +- frame/recovery/src/mock.rs | 2 +- frame/referenda/src/mock.rs | 2 +- frame/remark/src/mock.rs | 2 +- frame/root-offences/src/mock.rs | 2 +- frame/salary/src/tests.rs | 2 +- frame/scheduler/src/mock.rs | 2 +- frame/scored-pool/src/mock.rs | 2 +- frame/session/benchmarking/src/mock.rs | 4 ++-- frame/session/src/mock.rs | 2 +- frame/society/src/mock.rs | 2 +- frame/staking/src/mock.rs | 4 ++-- frame/state-trie-migration/src/lib.rs | 2 +- frame/statement/src/mock.rs | 2 +- frame/sudo/src/mock.rs | 2 +- frame/support/test/compile_pass/src/lib.rs | 3 +-- .../no_std_genesis_config.rs | 4 ++-- .../number_of_pallets_exceeds_tuple_size.rs | 2 +- .../pallet_error_too_large.rs | 12 ++++++------ .../undefined_call_part.rs | 4 ++-- .../undefined_event_part.rs | 4 ++-- .../undefined_genesis_config_part.rs | 4 ++-- .../undefined_inherent_part.rs | 4 ++-- .../undefined_origin_part.rs | 4 ++-- .../undefined_validate_unsigned_part.rs | 4 ++-- frame/support/test/tests/pallet.rs | 2 +- frame/support/test/tests/pallet_instance.rs | 2 +- .../tests/pallet_ui/pallet_doc_arg_non_path.rs | 2 +- .../test/tests/pallet_ui/pallet_doc_empty.rs | 2 +- .../tests/pallet_ui/pallet_doc_invalid_arg.rs | 2 +- .../pallet_ui/pallet_doc_multiple_args.rs | 2 +- .../tests/pallet_ui/pass/dev_mode_valid.rs | 16 +++++----------- .../pass/where_clause_missing_hooks.rs | 15 +++++++++++---- frame/support/test/tests/runtime_metadata.rs | 3 +-- frame/support/test/tests/storage_layers.rs | 4 ++-- frame/system/src/lib.rs | 10 ---------- frame/timestamp/src/mock.rs | 2 +- frame/tips/src/tests.rs | 2 +- .../asset-tx-payment/src/mock.rs | 2 +- frame/transaction-payment/src/mock.rs | 2 +- frame/transaction-storage/src/mock.rs | 2 +- frame/treasury/src/tests.rs | 2 +- frame/uniques/src/mock.rs | 2 +- frame/utility/src/tests.rs | 2 +- frame/vesting/src/mock.rs | 2 +- frame/whitelist/src/mock.rs | 2 +- .../api/proc-macro/src/runtime_metadata.rs | 6 +++--- primitives/test-primitives/src/lib.rs | 2 +- test-utils/runtime/src/extrinsic.rs | 6 +++--- test-utils/runtime/src/lib.rs | 10 +++++----- test-utils/runtime/transaction-pool/src/lib.rs | 4 ++-- utils/frame/rpc/support/src/lib.rs | 2 +- utils/frame/rpc/system/src/lib.rs | 18 +++++++++--------- 121 files changed, 199 insertions(+), 210 deletions(-) diff --git a/bin/node-template/node/src/rpc.rs b/bin/node-template/node/src/rpc.rs index 981f375d0b462..53c59bc01f3e1 100644 --- a/bin/node-template/node/src/rpc.rs +++ b/bin/node-template/node/src/rpc.rs @@ -8,7 +8,7 @@ use std::sync::Arc; use jsonrpsee::RpcModule; -use node_template_runtime::{opaque::Block, AccountId, Balance, Index}; +use node_template_runtime::{opaque::Block, AccountId, Balance, Nonce}; use sc_transaction_pool_api::TransactionPool; use sp_api::ProvideRuntimeApi; use sp_block_builder::BlockBuilder; @@ -34,7 +34,7 @@ where C: ProvideRuntimeApi, C: HeaderBackend + HeaderMetadata + 'static, C: Send + Sync + 'static, - C::Api: substrate_frame_rpc_system::AccountNonceApi, + C::Api: substrate_frame_rpc_system::AccountNonceApi, C::Api: pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi, C::Api: BlockBuilder, P: TransactionPool + 'static, diff --git a/bin/node-template/pallets/template/src/mock.rs b/bin/node-template/pallets/template/src/mock.rs index b4d6905378a5d..84e32b9c679ec 100644 --- a/bin/node-template/pallets/template/src/mock.rs +++ b/bin/node-template/pallets/template/src/mock.rs @@ -28,7 +28,7 @@ impl frame_system::Config for Test { type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; - type Index = u64; + type Nonce = u64; type BlockNumber = u64; type Hash = H256; type Hashing = BlakeTwo256; diff --git a/bin/node-template/runtime/src/lib.rs b/bin/node-template/runtime/src/lib.rs index 49346fbdd77da..dfce14214f48f 100644 --- a/bin/node-template/runtime/src/lib.rs +++ b/bin/node-template/runtime/src/lib.rs @@ -62,7 +62,7 @@ pub type AccountId = <::Signer as IdentifyAccount>::Account pub type Balance = u128; /// Index of a transaction in the chain. -pub type Index = u32; +pub type Nonce = u32; /// A hash of some data used by the chain. pub type Hash = sp_core::H256; @@ -164,8 +164,8 @@ impl frame_system::Config for Runtime { type RuntimeCall = RuntimeCall; /// The lookup mechanism to get account ID from whatever is passed in dispatchers. type Lookup = AccountIdLookup; - /// The index type for storing how many extrinsics an account has signed. - type Index = Index; + /// The type for storing how many extrinsics an account has signed. + type Nonce = Nonce; /// The index type for blocks. type BlockNumber = BlockNumber; /// The type for hashing blocks and tries. @@ -460,8 +460,8 @@ impl_runtime_apis! { } } - impl frame_system_rpc_runtime_api::AccountNonceApi for Runtime { - fn account_nonce(account: AccountId) -> Index { + impl frame_system_rpc_runtime_api::AccountNonceApi for Runtime { + fn account_nonce(account: AccountId) -> Nonce { System::account_nonce(account) } } diff --git a/bin/node/cli/benches/block_production.rs b/bin/node/cli/benches/block_production.rs index 527b145c62c46..c1d5171d8ed9e 100644 --- a/bin/node/cli/benches/block_production.rs +++ b/bin/node/cli/benches/block_production.rs @@ -154,7 +154,7 @@ fn prepare_benchmark(client: &FullClient) -> (usize, Vec) { let src = Sr25519Keyring::Alice.pair(); let dst: MultiAddress = Sr25519Keyring::Bob.to_account_id().into(); - // Add as many tranfer extrinsics as possible into a single block. + // Add as many transfer extrinsics as possible into a single block. for nonce in 0.. { let extrinsic: OpaqueExtrinsic = create_extrinsic( client, diff --git a/bin/node/executor/tests/basic.rs b/bin/node/executor/tests/basic.rs index d301aa06f90b0..a2f46e9fdbe99 100644 --- a/bin/node/executor/tests/basic.rs +++ b/bin/node/executor/tests/basic.rs @@ -183,7 +183,7 @@ fn panic_execution_with_foreign_code_gives_error() { let mut t = new_test_ext(bloaty_code_unwrap()); t.insert( >::hashed_key_for(alice()), - AccountInfo::<::Index, _> { + AccountInfo::<::Nonce, _> { providers: 1, data: (69u128, 0u128, 0u128, 1u128 << 127), ..Default::default() @@ -209,7 +209,7 @@ fn bad_extrinsic_with_native_equivalent_code_gives_error() { let mut t = new_test_ext(compact_code_unwrap()); t.insert( >::hashed_key_for(alice()), - AccountInfo::<::Index, _> { + AccountInfo::<::Nonce, _> { providers: 1, data: (69u128, 0u128, 0u128, 1u128 << 127), ..Default::default() @@ -235,7 +235,7 @@ fn successful_execution_with_native_equivalent_code_gives_ok() { let mut t = new_test_ext(compact_code_unwrap()); t.insert( >::hashed_key_for(alice()), - AccountInfo::<::Index, _> { + AccountInfo::<::Nonce, _> { providers: 1, data: (111 * DOLLARS, 0u128, 0u128, 1u128 << 127), ..Default::default() @@ -245,7 +245,7 @@ fn successful_execution_with_native_equivalent_code_gives_ok() { t.insert( >::hashed_key_for(bob()), AccountInfo::< - ::Index, + ::Nonce, ::AccountData, >::default() .encode(), @@ -277,7 +277,7 @@ fn successful_execution_with_foreign_code_gives_ok() { let mut t = new_test_ext(bloaty_code_unwrap()); t.insert( >::hashed_key_for(alice()), - AccountInfo::<::Index, _> { + AccountInfo::<::Nonce, _> { providers: 1, data: (111 * DOLLARS, 0u128, 0u128, 1u128 << 127), ..Default::default() @@ -287,7 +287,7 @@ fn successful_execution_with_foreign_code_gives_ok() { t.insert( >::hashed_key_for(bob()), AccountInfo::< - ::Index, + ::Nonce, ::AccountData, >::default() .encode(), @@ -766,7 +766,7 @@ fn panic_execution_gives_error() { let mut t = new_test_ext(bloaty_code_unwrap()); t.insert( >::hashed_key_for(alice()), - AccountInfo::<::Index, _> { + AccountInfo::<::Nonce, _> { data: (0 * DOLLARS, 0u128, 0u128, 0u128), ..Default::default() } @@ -795,7 +795,7 @@ fn successful_execution_gives_ok() { let mut t = new_test_ext(compact_code_unwrap()); t.insert( >::hashed_key_for(alice()), - AccountInfo::<::Index, _> { + AccountInfo::<::Nonce, _> { providers: 1, data: (111 * DOLLARS, 0u128, 0u128, 1u128 << 127), ..Default::default() @@ -805,7 +805,7 @@ fn successful_execution_gives_ok() { t.insert( >::hashed_key_for(bob()), AccountInfo::< - ::Index, + ::Nonce, ::AccountData, >::default() .encode(), diff --git a/bin/node/executor/tests/fees.rs b/bin/node/executor/tests/fees.rs index 970d790a87d3b..7519ce6e8b1b4 100644 --- a/bin/node/executor/tests/fees.rs +++ b/bin/node/executor/tests/fees.rs @@ -196,7 +196,7 @@ fn transaction_fee_is_correct() { fn block_weight_capacity_report() { // Just report how many transfer calls you could fit into a block. The number should at least // be a few hundred (250 at the time of writing but can change over time). Runs until panic. - use node_primitives::Index; + use node_primitives::Nonce; // execution ext. let mut t = new_test_ext(compact_code_unwrap()); @@ -205,7 +205,7 @@ fn block_weight_capacity_report() { let factor = 50; let mut time = 10; - let mut nonce: Index = 0; + let mut nonce: Nonce = 0; let mut block_number = 1; let mut previous_hash: node_primitives::Hash = GENESIS_HASH.into(); @@ -213,7 +213,7 @@ fn block_weight_capacity_report() { let num_transfers = block_number * factor; let mut xts = (0..num_transfers) .map(|i| CheckedExtrinsic { - signed: Some((charlie(), signed_extra(nonce + i as Index, 0))), + signed: Some((charlie(), signed_extra(nonce + i as Nonce, 0))), function: RuntimeCall::Balances(pallet_balances::Call::transfer_allow_death { dest: bob().into(), value: 0, @@ -266,7 +266,7 @@ fn block_length_capacity_report() { // Just report how big a block can get. Executes until panic. Should be ignored unless if // manually inspected. The number should at least be a few megabytes (5 at the time of // writing but can change over time). - use node_primitives::Index; + use node_primitives::Nonce; // execution ext. let mut t = new_test_ext(compact_code_unwrap()); @@ -275,7 +275,7 @@ fn block_length_capacity_report() { let factor = 256 * 1024; let mut time = 10; - let mut nonce: Index = 0; + let mut nonce: Nonce = 0; let mut block_number = 1; let mut previous_hash: node_primitives::Hash = GENESIS_HASH.into(); diff --git a/bin/node/primitives/src/lib.rs b/bin/node/primitives/src/lib.rs index e2fa5c3108149..24a67cbdd8f78 100644 --- a/bin/node/primitives/src/lib.rs +++ b/bin/node/primitives/src/lib.rs @@ -46,7 +46,7 @@ pub type Balance = u128; pub type Moment = u64; /// Index of a transaction in the chain. -pub type Index = u32; +pub type Nonce = u32; /// A hash of some data used by the chain. pub type Hash = sp_core::H256; diff --git a/bin/node/rpc/src/lib.rs b/bin/node/rpc/src/lib.rs index 5ab96bf1c7064..02ac761a85659 100644 --- a/bin/node/rpc/src/lib.rs +++ b/bin/node/rpc/src/lib.rs @@ -34,7 +34,7 @@ use std::sync::Arc; use jsonrpsee::RpcModule; -use node_primitives::{AccountId, Balance, Block, BlockNumber, Hash, Index}; +use node_primitives::{AccountId, Balance, Block, BlockNumber, Hash, Nonce}; use sc_client_api::AuxStore; use sc_consensus_babe::BabeWorkerHandle; use sc_consensus_grandpa::{ @@ -106,7 +106,7 @@ where + Sync + Send + 'static, - C::Api: substrate_frame_rpc_system::AccountNonceApi, + C::Api: substrate_frame_rpc_system::AccountNonceApi, C::Api: mmr_rpc::MmrRuntimeApi::Hash, BlockNumber>, C::Api: pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi, C::Api: BabeApi, diff --git a/bin/node/runtime/src/lib.rs b/bin/node/runtime/src/lib.rs index 47134f41f0ddf..7830a3bb23073 100644 --- a/bin/node/runtime/src/lib.rs +++ b/bin/node/runtime/src/lib.rs @@ -51,7 +51,7 @@ use frame_system::{ EnsureRoot, EnsureRootWithSuccess, EnsureSigned, EnsureWithSuccess, }; pub use node_primitives::{AccountId, Signature}; -use node_primitives::{AccountIndex, Balance, BlockNumber, Hash, Index, Moment}; +use node_primitives::{AccountIndex, Balance, BlockNumber, Hash, Moment, Nonce}; use pallet_election_provider_multi_phase::SolutionAccuracyOf; use pallet_im_online::sr25519::AuthorityId as ImOnlineId; use pallet_nfts::PalletFeatures; @@ -222,7 +222,7 @@ impl frame_system::Config for Runtime { type DbWeight = RocksDbWeight; type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; - type Index = Index; + type Nonce = Nonce; type BlockNumber = BlockNumber; type Hash = Hash; type Hashing = BlakeTwo256; @@ -1275,7 +1275,7 @@ where call: RuntimeCall, public: ::Signer, account: AccountId, - nonce: Index, + nonce: Nonce, ) -> Option<(RuntimeCall, ::SignaturePayload)> { let tip = 0; // take the biggest period possible. @@ -2193,8 +2193,8 @@ impl_runtime_apis! { } } - impl frame_system_rpc_runtime_api::AccountNonceApi for Runtime { - fn account_nonce(account: AccountId) -> Index { + impl frame_system_rpc_runtime_api::AccountNonceApi for Runtime { + fn account_nonce(account: AccountId) -> Nonce { System::account_nonce(account) } } diff --git a/bin/node/testing/src/keyring.rs b/bin/node/testing/src/keyring.rs index e16502bf17554..0fecca08d32d9 100644 --- a/bin/node/testing/src/keyring.rs +++ b/bin/node/testing/src/keyring.rs @@ -20,7 +20,7 @@ use codec::Encode; use kitchensink_runtime::{CheckedExtrinsic, SessionKeys, SignedExtra, UncheckedExtrinsic}; -use node_primitives::{AccountId, Balance, Index}; +use node_primitives::{AccountId, Balance, Nonce}; use sp_keyring::{AccountKeyring, Ed25519Keyring, Sr25519Keyring}; use sp_runtime::generic::Era; @@ -68,7 +68,7 @@ pub fn to_session_keys( } /// Returns transaction extra. -pub fn signed_extra(nonce: Index, extra_fee: Balance) -> SignedExtra { +pub fn signed_extra(nonce: Nonce, extra_fee: Balance) -> SignedExtra { ( frame_system::CheckNonZeroSender::new(), frame_system::CheckSpecVersion::new(), diff --git a/client/transaction-pool/tests/pool.rs b/client/transaction-pool/tests/pool.rs index ac029d71700da..4adf811b42521 100644 --- a/client/transaction-pool/tests/pool.rs +++ b/client/transaction-pool/tests/pool.rs @@ -39,7 +39,7 @@ use sp_runtime::{ }; use std::{collections::BTreeSet, pin::Pin, sync::Arc}; use substrate_test_runtime_client::{ - runtime::{Block, Extrinsic, ExtrinsicBuilder, Hash, Header, Index, Transfer, TransferData}, + runtime::{Block, Extrinsic, ExtrinsicBuilder, Hash, Header, Nonce, Transfer, TransferData}, AccountKeyring::*, ClientBlockImportExt, }; @@ -119,7 +119,7 @@ fn early_nonce_should_be_culled() { .ready() .map(|a| TransferData::try_from(&a.data).unwrap().nonce) .collect(); - assert_eq!(pending, Vec::::new()); + assert_eq!(pending, Vec::::new()); } #[test] @@ -132,7 +132,7 @@ fn late_nonce_should_be_queued() { .ready() .map(|a| TransferData::try_from(&a.data).unwrap().nonce) .collect(); - assert_eq!(pending, Vec::::new()); + assert_eq!(pending, Vec::::new()); block_on(pool.submit_one(&BlockId::number(0), SOURCE, uxt(Alice, 209))).unwrap(); let pending: Vec<_> = pool @@ -182,7 +182,7 @@ fn should_ban_invalid_transactions() { .ready() .map(|a| TransferData::try_from(&a.data).unwrap().nonce) .collect(); - assert_eq!(pending, Vec::::new()); + assert_eq!(pending, Vec::::new()); // then block_on(pool.submit_one(&BlockId::number(0), SOURCE, uxt.clone())).unwrap_err(); diff --git a/frame/alliance/src/mock.rs b/frame/alliance/src/mock.rs index c334a3943b025..83e2da995b5db 100644 --- a/frame/alliance/src/mock.rs +++ b/frame/alliance/src/mock.rs @@ -52,7 +52,7 @@ impl frame_system::Config for Test { type BlockLength = (); type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; - type Index = u64; + type Nonce = u64; type BlockNumber = BlockNumber; type Hash = H256; type Hashing = BlakeTwo256; diff --git a/frame/asset-rate/src/mock.rs b/frame/asset-rate/src/mock.rs index 9775b7a747926..981d9f71a1983 100644 --- a/frame/asset-rate/src/mock.rs +++ b/frame/asset-rate/src/mock.rs @@ -47,7 +47,7 @@ impl frame_system::Config for Test { type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; - type Index = u64; + type Nonce = u64; type BlockNumber = u64; type Hash = H256; type Hashing = BlakeTwo256; diff --git a/frame/assets/src/mock.rs b/frame/assets/src/mock.rs index 3926d2fa8b010..444eb5ae20f8b 100644 --- a/frame/assets/src/mock.rs +++ b/frame/assets/src/mock.rs @@ -56,7 +56,7 @@ impl frame_system::Config for Test { type BlockLength = (); type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; - type Index = u64; + type Nonce = u64; type BlockNumber = u64; type Hash = H256; type Hashing = BlakeTwo256; diff --git a/frame/atomic-swap/src/tests.rs b/frame/atomic-swap/src/tests.rs index 7437d62a99c95..6eda9f2c2c1c3 100644 --- a/frame/atomic-swap/src/tests.rs +++ b/frame/atomic-swap/src/tests.rs @@ -31,7 +31,7 @@ impl frame_system::Config for Test { type BlockLength = (); type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; - type Index = u64; + type Nonce = u64; type BlockNumber = u64; type Hash = H256; type RuntimeCall = RuntimeCall; diff --git a/frame/aura/src/mock.rs b/frame/aura/src/mock.rs index 72d11a0749933..c9e867d30bbdb 100644 --- a/frame/aura/src/mock.rs +++ b/frame/aura/src/mock.rs @@ -52,7 +52,7 @@ impl frame_system::Config for Test { type BlockLength = (); type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; - type Index = u64; + type Nonce = u64; type BlockNumber = u64; type RuntimeCall = RuntimeCall; type Hash = H256; diff --git a/frame/authority-discovery/src/lib.rs b/frame/authority-discovery/src/lib.rs index 6365c95359472..6312b6642e7fd 100644 --- a/frame/authority-discovery/src/lib.rs +++ b/frame/authority-discovery/src/lib.rs @@ -233,7 +233,7 @@ mod tests { type BlockLength = (); type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; - type Index = u64; + type Nonce = u64; type BlockNumber = BlockNumber; type RuntimeCall = RuntimeCall; type Hash = H256; diff --git a/frame/authorship/src/lib.rs b/frame/authorship/src/lib.rs index 4bb8ba587ac8b..d30c46e023381 100644 --- a/frame/authorship/src/lib.rs +++ b/frame/authorship/src/lib.rs @@ -128,7 +128,7 @@ mod tests { type BlockLength = (); type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; - type Index = u64; + type Nonce = u64; type BlockNumber = u64; type RuntimeCall = RuntimeCall; type Hash = H256; diff --git a/frame/babe/src/mock.rs b/frame/babe/src/mock.rs index 4278fa4596a96..0877ebeda2db4 100644 --- a/frame/babe/src/mock.rs +++ b/frame/babe/src/mock.rs @@ -69,7 +69,7 @@ impl frame_system::Config for Test { type BlockLength = (); type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; - type Index = u64; + type Nonce = u64; type BlockNumber = u64; type RuntimeCall = RuntimeCall; type Hash = H256; diff --git a/frame/bags-list/src/mock.rs b/frame/bags-list/src/mock.rs index efbb2ed94c49f..5b53163d2d103 100644 --- a/frame/bags-list/src/mock.rs +++ b/frame/bags-list/src/mock.rs @@ -51,7 +51,7 @@ impl frame_system::Config for Runtime { type SS58Prefix = (); type BaseCallFilter = frame_support::traits::Everything; type RuntimeOrigin = RuntimeOrigin; - type Index = u64; + type Nonce = u64; type BlockNumber = u64; type RuntimeCall = RuntimeCall; type Hash = sp_core::H256; diff --git a/frame/balances/src/tests/mod.rs b/frame/balances/src/tests/mod.rs index 4731dbf8ed32b..9fdf5c438e4e2 100644 --- a/frame/balances/src/tests/mod.rs +++ b/frame/balances/src/tests/mod.rs @@ -97,7 +97,7 @@ impl frame_system::Config for Test { type BlockLength = (); type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; - type Index = u64; + type Nonce = u64; type BlockNumber = u64; type RuntimeCall = RuntimeCall; type Hash = H256; diff --git a/frame/beefy-mmr/src/mock.rs b/frame/beefy-mmr/src/mock.rs index 8b3bedcb960b4..2855cc6c02d59 100644 --- a/frame/beefy-mmr/src/mock.rs +++ b/frame/beefy-mmr/src/mock.rs @@ -68,7 +68,7 @@ impl frame_system::Config for Test { type BlockLength = (); type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; - type Index = u64; + type Nonce = u64; type BlockNumber = u64; type Hash = H256; type RuntimeCall = RuntimeCall; diff --git a/frame/beefy/src/mock.rs b/frame/beefy/src/mock.rs index 6b6ffd6751fbe..905fc598c7345 100644 --- a/frame/beefy/src/mock.rs +++ b/frame/beefy/src/mock.rs @@ -78,7 +78,7 @@ impl frame_system::Config for Test { type BlockLength = (); type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; - type Index = u64; + type Nonce = u64; type BlockNumber = u64; type Hash = H256; type RuntimeCall = RuntimeCall; diff --git a/frame/benchmarking/pov/src/benchmarking.rs b/frame/benchmarking/pov/src/benchmarking.rs index 27191e37219fd..cb460ba787076 100644 --- a/frame/benchmarking/pov/src/benchmarking.rs +++ b/frame/benchmarking/pov/src/benchmarking.rs @@ -342,7 +342,7 @@ mod mock { use sp_runtime::testing::H256; type AccountId = u64; - type AccountIndex = u32; + type AccountNonce = u32; type BlockNumber = u64; type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; @@ -365,7 +365,7 @@ mod mock { type BlockLength = (); type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; - type Index = AccountIndex; + type Nonce = AccountNonce; type BlockNumber = BlockNumber; type RuntimeCall = RuntimeCall; type Hash = H256; diff --git a/frame/benchmarking/pov/src/tests.rs b/frame/benchmarking/pov/src/tests.rs index b908925cccd8e..eb8bf1864a158 100644 --- a/frame/benchmarking/pov/src/tests.rs +++ b/frame/benchmarking/pov/src/tests.rs @@ -184,7 +184,7 @@ mod mock { type BlockLength = (); type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; - type Index = u32; + type Nonce = u32; type BlockNumber = u64; type RuntimeCall = RuntimeCall; type Hash = H256; diff --git a/frame/benchmarking/src/baseline.rs b/frame/benchmarking/src/baseline.rs index 25336b6974d9f..1a33da4f0099e 100644 --- a/frame/benchmarking/src/baseline.rs +++ b/frame/benchmarking/src/baseline.rs @@ -114,7 +114,7 @@ pub mod mock { use sp_runtime::testing::H256; type AccountId = u64; - type AccountIndex = u32; + type AccountNonce = u32; type BlockNumber = u64; type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; @@ -136,7 +136,7 @@ pub mod mock { type BlockLength = (); type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; - type Index = AccountIndex; + type Nonce = AccountNonce; type BlockNumber = BlockNumber; type RuntimeCall = RuntimeCall; type Hash = H256; diff --git a/frame/benchmarking/src/tests.rs b/frame/benchmarking/src/tests.rs index 7e240ee04903a..fe74521475eb6 100644 --- a/frame/benchmarking/src/tests.rs +++ b/frame/benchmarking/src/tests.rs @@ -86,7 +86,7 @@ impl frame_system::Config for Test { type BlockLength = (); type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; - type Index = u64; + type Nonce = u64; type BlockNumber = u64; type Hash = H256; type RuntimeCall = RuntimeCall; diff --git a/frame/benchmarking/src/tests_instance.rs b/frame/benchmarking/src/tests_instance.rs index d017fc679875e..68040d1192114 100644 --- a/frame/benchmarking/src/tests_instance.rs +++ b/frame/benchmarking/src/tests_instance.rs @@ -96,7 +96,7 @@ impl frame_system::Config for Test { type BlockLength = (); type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; - type Index = u64; + type Nonce = u64; type BlockNumber = u64; type Hash = H256; type Hashing = BlakeTwo256; diff --git a/frame/bounties/src/tests.rs b/frame/bounties/src/tests.rs index ef3da7564874e..8e969051224dc 100644 --- a/frame/bounties/src/tests.rs +++ b/frame/bounties/src/tests.rs @@ -69,7 +69,7 @@ impl frame_system::Config for Test { type BlockLength = (); type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; - type Index = u64; + type Nonce = u64; type BlockNumber = u64; type RuntimeCall = RuntimeCall; type Hash = H256; diff --git a/frame/child-bounties/src/tests.rs b/frame/child-bounties/src/tests.rs index a936312aec868..4d5faec0f9ccd 100644 --- a/frame/child-bounties/src/tests.rs +++ b/frame/child-bounties/src/tests.rs @@ -72,7 +72,7 @@ impl frame_system::Config for Test { type BlockLength = (); type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; - type Index = u64; + type Nonce = u64; type BlockNumber = u64; type RuntimeCall = RuntimeCall; type Hash = H256; diff --git a/frame/collective/src/tests.rs b/frame/collective/src/tests.rs index 99aa7a57e1604..20c4261b07b34 100644 --- a/frame/collective/src/tests.rs +++ b/frame/collective/src/tests.rs @@ -99,7 +99,7 @@ impl frame_system::Config for Test { type BlockLength = (); type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; - type Index = u64; + type Nonce = u64; type BlockNumber = u64; type RuntimeCall = RuntimeCall; type Hash = H256; diff --git a/frame/contracts/src/tests.rs b/frame/contracts/src/tests.rs index c32999d0ade3a..7e5dbcec78640 100644 --- a/frame/contracts/src/tests.rs +++ b/frame/contracts/src/tests.rs @@ -289,7 +289,7 @@ impl frame_system::Config for Test { type BlockLength = (); type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; - type Index = u64; + type Nonce = u64; type BlockNumber = u64; type Hash = H256; type RuntimeCall = RuntimeCall; diff --git a/frame/conviction-voting/src/tests.rs b/frame/conviction-voting/src/tests.rs index f33e511a164f6..d8c0990edc3f1 100644 --- a/frame/conviction-voting/src/tests.rs +++ b/frame/conviction-voting/src/tests.rs @@ -61,7 +61,7 @@ impl frame_system::Config for Test { type BlockLength = (); type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; - type Index = u64; + type Nonce = u64; type BlockNumber = u64; type RuntimeCall = RuntimeCall; type Hash = H256; diff --git a/frame/core-fellowship/src/tests.rs b/frame/core-fellowship/src/tests.rs index 87c0de112ac33..0b9192a1d52af 100644 --- a/frame/core-fellowship/src/tests.rs +++ b/frame/core-fellowship/src/tests.rs @@ -61,7 +61,7 @@ impl frame_system::Config for Test { type BlockLength = (); type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; - type Index = u64; + type Nonce = u64; type BlockNumber = u64; type RuntimeCall = RuntimeCall; type Hash = H256; diff --git a/frame/democracy/src/tests.rs b/frame/democracy/src/tests.rs index 06fde5129c6d0..0e9feebc5419b 100644 --- a/frame/democracy/src/tests.rs +++ b/frame/democracy/src/tests.rs @@ -88,7 +88,7 @@ impl frame_system::Config for Test { type BlockLength = (); type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; - type Index = u64; + type Nonce = u64; type BlockNumber = u64; type RuntimeCall = RuntimeCall; type Hash = H256; diff --git a/frame/election-provider-multi-phase/src/mock.rs b/frame/election-provider-multi-phase/src/mock.rs index 732a650ce6db1..a7bef5bbce8f1 100644 --- a/frame/election-provider-multi-phase/src/mock.rs +++ b/frame/election-provider-multi-phase/src/mock.rs @@ -211,7 +211,7 @@ impl frame_system::Config for Runtime { type SS58Prefix = (); type BaseCallFilter = frame_support::traits::Everything; type RuntimeOrigin = RuntimeOrigin; - type Index = u64; + type Nonce = u64; type BlockNumber = BlockNumber; type RuntimeCall = RuntimeCall; type Hash = H256; diff --git a/frame/election-provider-multi-phase/test-staking-e2e/src/mock.rs b/frame/election-provider-multi-phase/test-staking-e2e/src/mock.rs index 490179e91ddda..c8191c6e6fae8 100644 --- a/frame/election-provider-multi-phase/test-staking-e2e/src/mock.rs +++ b/frame/election-provider-multi-phase/test-staking-e2e/src/mock.rs @@ -71,7 +71,7 @@ frame_support::construct_runtime!( ); pub(crate) type AccountId = u128; -pub(crate) type AccountIndex = u32; +pub(crate) type AccountNonce = u32; pub(crate) type BlockNumber = u64; pub(crate) type Balance = u64; pub(crate) type VoterIndex = u32; @@ -84,7 +84,7 @@ impl frame_system::Config for Runtime { type BlockLength = (); type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; - type Index = AccountIndex; + type Nonce = AccountNonce; type BlockNumber = BlockNumber; type RuntimeCall = RuntimeCall; type Hash = H256; diff --git a/frame/election-provider-support/src/onchain.rs b/frame/election-provider-support/src/onchain.rs index a312562d4944c..5af021452e841 100644 --- a/frame/election-provider-support/src/onchain.rs +++ b/frame/election-provider-support/src/onchain.rs @@ -210,7 +210,7 @@ mod tests { type SS58Prefix = (); type BaseCallFilter = frame_support::traits::Everything; type RuntimeOrigin = RuntimeOrigin; - type Index = AccountId; + type Nonce = AccountId; type BlockNumber = BlockNumber; type RuntimeCall = RuntimeCall; type Hash = sp_core::H256; diff --git a/frame/elections-phragmen/src/lib.rs b/frame/elections-phragmen/src/lib.rs index 33a8634cb3bc9..55c013e163691 100644 --- a/frame/elections-phragmen/src/lib.rs +++ b/frame/elections-phragmen/src/lib.rs @@ -1319,7 +1319,7 @@ mod tests { type BlockLength = (); type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; - type Index = u64; + type Nonce = u64; type BlockNumber = u64; type RuntimeCall = RuntimeCall; type Hash = H256; diff --git a/frame/examples/basic/src/tests.rs b/frame/examples/basic/src/tests.rs index 1d9cf81a5074c..3f91945cbc788 100644 --- a/frame/examples/basic/src/tests.rs +++ b/frame/examples/basic/src/tests.rs @@ -56,7 +56,7 @@ impl frame_system::Config for Test { type BlockLength = (); type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; - type Index = u64; + type Nonce = u64; type BlockNumber = u64; type Hash = H256; type RuntimeCall = RuntimeCall; diff --git a/frame/examples/dev-mode/src/tests.rs b/frame/examples/dev-mode/src/tests.rs index e2f06ddda6cd7..b20e4ea4855d8 100644 --- a/frame/examples/dev-mode/src/tests.rs +++ b/frame/examples/dev-mode/src/tests.rs @@ -50,7 +50,7 @@ impl frame_system::Config for Test { type BlockLength = (); type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; - type Index = u64; + type Nonce = u64; type BlockNumber = u64; type Hash = H256; type RuntimeCall = RuntimeCall; diff --git a/frame/examples/offchain-worker/src/tests.rs b/frame/examples/offchain-worker/src/tests.rs index 3df7f4a8d5439..8acdfff22fcde 100644 --- a/frame/examples/offchain-worker/src/tests.rs +++ b/frame/examples/offchain-worker/src/tests.rs @@ -57,7 +57,7 @@ impl frame_system::Config for Test { type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; - type Index = u64; + type Nonce = u64; type BlockNumber = u64; type Hash = H256; type Hashing = BlakeTwo256; diff --git a/frame/executive/src/lib.rs b/frame/executive/src/lib.rs index 9ec78f254212e..f7dad11b71534 100644 --- a/frame/executive/src/lib.rs +++ b/frame/executive/src/lib.rs @@ -852,7 +852,7 @@ mod tests { type BlockLength = (); type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; - type Index = u64; + type Nonce = u64; type RuntimeCall = RuntimeCall; type BlockNumber = u64; type Hash = sp_core::H256; diff --git a/frame/fast-unstake/src/mock.rs b/frame/fast-unstake/src/mock.rs index d75c893807990..58fee8a87d75e 100644 --- a/frame/fast-unstake/src/mock.rs +++ b/frame/fast-unstake/src/mock.rs @@ -29,7 +29,7 @@ use pallet_staking::{Exposure, IndividualExposure, StakerStatus}; use sp_std::prelude::*; pub type AccountId = u128; -pub type AccountIndex = u32; +pub type AccountNonce = u32; pub type BlockNumber = u64; pub type Balance = u128; pub type T = Runtime; @@ -47,7 +47,7 @@ impl frame_system::Config for Runtime { type BlockLength = (); type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; - type Index = AccountIndex; + type Nonce = AccountNonce; type BlockNumber = BlockNumber; type RuntimeCall = RuntimeCall; type Hash = sp_core::H256; diff --git a/frame/glutton/src/mock.rs b/frame/glutton/src/mock.rs index 8c331dc97ab2b..cab6606256e7b 100644 --- a/frame/glutton/src/mock.rs +++ b/frame/glutton/src/mock.rs @@ -45,7 +45,7 @@ impl frame_system::Config for Test { type BlockLength = (); type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; - type Index = u64; + type Nonce = u64; type BlockNumber = u64; type Hash = H256; type RuntimeCall = RuntimeCall; diff --git a/frame/grandpa/src/mock.rs b/frame/grandpa/src/mock.rs index ffc566ffe74de..740776d2652b3 100644 --- a/frame/grandpa/src/mock.rs +++ b/frame/grandpa/src/mock.rs @@ -75,7 +75,7 @@ impl frame_system::Config for Test { type BlockLength = (); type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; - type Index = u64; + type Nonce = u64; type BlockNumber = u64; type RuntimeCall = RuntimeCall; type Hash = H256; diff --git a/frame/identity/src/tests.rs b/frame/identity/src/tests.rs index ba9749172e5f6..be5ad78c17e97 100644 --- a/frame/identity/src/tests.rs +++ b/frame/identity/src/tests.rs @@ -53,7 +53,7 @@ impl frame_system::Config for Test { type BlockWeights = (); type BlockLength = (); type RuntimeOrigin = RuntimeOrigin; - type Index = u64; + type Nonce = u64; type BlockNumber = u64; type Hash = H256; type RuntimeCall = RuntimeCall; diff --git a/frame/im-online/src/mock.rs b/frame/im-online/src/mock.rs index 64e77b24b9b09..ddd1f3ea68db2 100644 --- a/frame/im-online/src/mock.rs +++ b/frame/im-online/src/mock.rs @@ -123,7 +123,7 @@ impl frame_system::Config for Runtime { type BlockLength = (); type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; - type Index = u64; + type Nonce = u64; type BlockNumber = u64; type RuntimeCall = RuntimeCall; type Hash = H256; diff --git a/frame/indices/src/mock.rs b/frame/indices/src/mock.rs index 8bd05d04ab4e1..d3cca5a7e79a0 100644 --- a/frame/indices/src/mock.rs +++ b/frame/indices/src/mock.rs @@ -46,7 +46,7 @@ impl frame_system::Config for Test { type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; - type Index = u64; + type Nonce = u64; type BlockNumber = u64; type Hash = H256; type Hashing = ::sp_runtime::traits::BlakeTwo256; diff --git a/frame/insecure-randomness-collective-flip/src/lib.rs b/frame/insecure-randomness-collective-flip/src/lib.rs index ad39c4c4fd885..80fd48ded191d 100644 --- a/frame/insecure-randomness-collective-flip/src/lib.rs +++ b/frame/insecure-randomness-collective-flip/src/lib.rs @@ -199,7 +199,7 @@ mod tests { type BlockLength = BlockLength; type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; - type Index = u64; + type Nonce = u64; type BlockNumber = u64; type RuntimeCall = RuntimeCall; type Hash = H256; diff --git a/frame/lottery/src/mock.rs b/frame/lottery/src/mock.rs index 7afd0e319db34..b2635a7dfe016 100644 --- a/frame/lottery/src/mock.rs +++ b/frame/lottery/src/mock.rs @@ -58,7 +58,7 @@ impl frame_system::Config for Test { type BlockLength = (); type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; - type Index = u64; + type Nonce = u64; type RuntimeCall = RuntimeCall; type BlockNumber = u64; type Hash = H256; diff --git a/frame/membership/src/lib.rs b/frame/membership/src/lib.rs index 74891186a4e22..094e677862efb 100644 --- a/frame/membership/src/lib.rs +++ b/frame/membership/src/lib.rs @@ -559,7 +559,7 @@ mod tests { type BlockLength = (); type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; - type Index = u64; + type Nonce = u64; type BlockNumber = u64; type Hash = H256; type RuntimeCall = RuntimeCall; diff --git a/frame/merkle-mountain-range/src/mock.rs b/frame/merkle-mountain-range/src/mock.rs index 292c80a483325..694b448c2491c 100644 --- a/frame/merkle-mountain-range/src/mock.rs +++ b/frame/merkle-mountain-range/src/mock.rs @@ -48,7 +48,7 @@ impl frame_system::Config for Test { type BaseCallFilter = frame_support::traits::Everything; type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; - type Index = u64; + type Nonce = u64; type BlockNumber = u64; type Hash = H256; type Hashing = BlakeTwo256; diff --git a/frame/message-queue/src/integration_test.rs b/frame/message-queue/src/integration_test.rs index 255098b3b1415..962ed4abd96d7 100644 --- a/frame/message-queue/src/integration_test.rs +++ b/frame/message-queue/src/integration_test.rs @@ -63,7 +63,7 @@ impl frame_system::Config for Test { type BlockLength = (); type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; - type Index = u64; + type Nonce = u64; type BlockNumber = u64; type Hash = H256; type RuntimeCall = RuntimeCall; diff --git a/frame/message-queue/src/mock.rs b/frame/message-queue/src/mock.rs index 71f0b0fa20e30..15274ceba17d8 100644 --- a/frame/message-queue/src/mock.rs +++ b/frame/message-queue/src/mock.rs @@ -53,7 +53,7 @@ impl frame_system::Config for Test { type BlockLength = (); type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; - type Index = u64; + type Nonce = u64; type BlockNumber = u64; type Hash = H256; type RuntimeCall = RuntimeCall; diff --git a/frame/multisig/src/tests.rs b/frame/multisig/src/tests.rs index 7e7f1668026a2..4f2efe01e612a 100644 --- a/frame/multisig/src/tests.rs +++ b/frame/multisig/src/tests.rs @@ -54,7 +54,7 @@ impl frame_system::Config for Test { type BlockLength = (); type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; - type Index = u64; + type Nonce = u64; type BlockNumber = u64; type Hash = H256; type RuntimeCall = RuntimeCall; diff --git a/frame/nft-fractionalization/src/mock.rs b/frame/nft-fractionalization/src/mock.rs index 05fbadb039398..03a749965b5e8 100644 --- a/frame/nft-fractionalization/src/mock.rs +++ b/frame/nft-fractionalization/src/mock.rs @@ -62,7 +62,7 @@ impl frame_system::Config for Test { type BlockLength = (); type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; - type Index = u64; + type Nonce = u64; type BlockNumber = u64; type Hash = H256; type Hashing = BlakeTwo256; diff --git a/frame/nfts/src/mock.rs b/frame/nfts/src/mock.rs index e2856a07b994c..4191f42124827 100644 --- a/frame/nfts/src/mock.rs +++ b/frame/nfts/src/mock.rs @@ -57,7 +57,7 @@ impl frame_system::Config for Test { type BlockLength = (); type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; - type Index = u64; + type Nonce = u64; type BlockNumber = u64; type Hash = H256; type Hashing = BlakeTwo256; diff --git a/frame/nicks/src/lib.rs b/frame/nicks/src/lib.rs index 92865c773d886..faa31523b1232 100644 --- a/frame/nicks/src/lib.rs +++ b/frame/nicks/src/lib.rs @@ -264,7 +264,7 @@ mod tests { type BlockLength = (); type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; - type Index = u64; + type Nonce = u64; type BlockNumber = u64; type Hash = H256; type RuntimeCall = RuntimeCall; diff --git a/frame/nis/src/mock.rs b/frame/nis/src/mock.rs index 0ca6690936818..d40713349054b 100644 --- a/frame/nis/src/mock.rs +++ b/frame/nis/src/mock.rs @@ -62,7 +62,7 @@ impl frame_system::Config for Test { type BlockLength = (); type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; - type Index = u64; + type Nonce = u64; type BlockNumber = u64; type Hash = H256; type Hashing = BlakeTwo256; diff --git a/frame/node-authorization/src/mock.rs b/frame/node-authorization/src/mock.rs index b7c5957e15dee..de9573448cfb7 100644 --- a/frame/node-authorization/src/mock.rs +++ b/frame/node-authorization/src/mock.rs @@ -53,7 +53,7 @@ impl frame_system::Config for Test { type BlockWeights = (); type BlockLength = (); type RuntimeOrigin = RuntimeOrigin; - type Index = u64; + type Nonce = u64; type BlockNumber = u64; type Hash = H256; type RuntimeCall = RuntimeCall; diff --git a/frame/nomination-pools/benchmarking/src/mock.rs b/frame/nomination-pools/benchmarking/src/mock.rs index cffb712ea2ae5..ce5b908590f06 100644 --- a/frame/nomination-pools/benchmarking/src/mock.rs +++ b/frame/nomination-pools/benchmarking/src/mock.rs @@ -24,7 +24,7 @@ use sp_runtime::{ }; type AccountId = u128; -type AccountIndex = u32; +type AccountNonce = u32; type BlockNumber = u64; type Balance = u128; @@ -34,7 +34,7 @@ impl frame_system::Config for Runtime { type BlockLength = (); type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; - type Index = AccountIndex; + type Nonce = AccountNonce; type BlockNumber = BlockNumber; type RuntimeCall = RuntimeCall; type Hash = sp_core::H256; diff --git a/frame/nomination-pools/src/mock.rs b/frame/nomination-pools/src/mock.rs index 3ab9be516fdb9..31fb5a6fb2a0c 100644 --- a/frame/nomination-pools/src/mock.rs +++ b/frame/nomination-pools/src/mock.rs @@ -167,7 +167,7 @@ impl frame_system::Config for Runtime { type SS58Prefix = (); type BaseCallFilter = frame_support::traits::Everything; type RuntimeOrigin = RuntimeOrigin; - type Index = u64; + type Nonce = u64; type BlockNumber = BlockNumber; type RuntimeCall = RuntimeCall; type Hash = sp_core::H256; diff --git a/frame/nomination-pools/test-staking/src/mock.rs b/frame/nomination-pools/test-staking/src/mock.rs index 9726f5e6dad27..bee2c5db292f7 100644 --- a/frame/nomination-pools/test-staking/src/mock.rs +++ b/frame/nomination-pools/test-staking/src/mock.rs @@ -29,7 +29,7 @@ use sp_runtime::{ }; type AccountId = u128; -type AccountIndex = u32; +type AccountNonce = u32; type BlockNumber = u64; type Balance = u128; @@ -44,7 +44,7 @@ impl frame_system::Config for Runtime { type BlockLength = (); type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; - type Index = AccountIndex; + type Nonce = AccountNonce; type BlockNumber = BlockNumber; type RuntimeCall = RuntimeCall; type Hash = sp_core::H256; diff --git a/frame/offences/benchmarking/src/mock.rs b/frame/offences/benchmarking/src/mock.rs index 668d88e0bf3d0..866a81a4c910c 100644 --- a/frame/offences/benchmarking/src/mock.rs +++ b/frame/offences/benchmarking/src/mock.rs @@ -33,7 +33,7 @@ use sp_runtime::{ }; type AccountId = u64; -type AccountIndex = u32; +type AccountNonce = u32; type BlockNumber = u64; type Balance = u64; @@ -43,7 +43,7 @@ impl frame_system::Config for Test { type BlockLength = (); type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; - type Index = AccountIndex; + type Nonce = AccountNonce; type BlockNumber = BlockNumber; type RuntimeCall = RuntimeCall; type Hash = sp_core::H256; diff --git a/frame/offences/src/mock.rs b/frame/offences/src/mock.rs index 17480be76c1d8..212cda1f6966a 100644 --- a/frame/offences/src/mock.rs +++ b/frame/offences/src/mock.rs @@ -86,7 +86,7 @@ impl frame_system::Config for Runtime { type BlockLength = (); type DbWeight = RocksDbWeight; type RuntimeOrigin = RuntimeOrigin; - type Index = u64; + type Nonce = u64; type BlockNumber = u64; type RuntimeCall = RuntimeCall; type Hash = H256; diff --git a/frame/preimage/src/mock.rs b/frame/preimage/src/mock.rs index 5054a77a8123f..f608c0b57c0ad 100644 --- a/frame/preimage/src/mock.rs +++ b/frame/preimage/src/mock.rs @@ -54,7 +54,7 @@ impl frame_system::Config for Test { type DbWeight = RocksDbWeight; type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; - type Index = u64; + type Nonce = u64; type BlockNumber = u64; type Hash = H256; type Hashing = BlakeTwo256; diff --git a/frame/proxy/src/tests.rs b/frame/proxy/src/tests.rs index f3771083c4dd4..a025845f3b4f3 100644 --- a/frame/proxy/src/tests.rs +++ b/frame/proxy/src/tests.rs @@ -57,7 +57,7 @@ impl frame_system::Config for Test { type BlockLength = (); type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; - type Index = u64; + type Nonce = u64; type BlockNumber = u64; type Hash = H256; type RuntimeCall = RuntimeCall; diff --git a/frame/ranked-collective/src/tests.rs b/frame/ranked-collective/src/tests.rs index 04519bc0f8e22..3c0b5df12d4c4 100644 --- a/frame/ranked-collective/src/tests.rs +++ b/frame/ranked-collective/src/tests.rs @@ -55,7 +55,7 @@ impl frame_system::Config for Test { type BlockLength = (); type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; - type Index = u64; + type Nonce = u64; type BlockNumber = u64; type RuntimeCall = RuntimeCall; type Hash = H256; diff --git a/frame/recovery/src/mock.rs b/frame/recovery/src/mock.rs index 5c190e2a241a5..bce38d63655eb 100644 --- a/frame/recovery/src/mock.rs +++ b/frame/recovery/src/mock.rs @@ -52,7 +52,7 @@ impl frame_system::Config for Test { type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; - type Index = u64; + type Nonce = u64; type BlockNumber = u64; type Hash = H256; type Hashing = BlakeTwo256; diff --git a/frame/referenda/src/mock.rs b/frame/referenda/src/mock.rs index cdedb79556f35..05796056936ef 100644 --- a/frame/referenda/src/mock.rs +++ b/frame/referenda/src/mock.rs @@ -70,7 +70,7 @@ impl frame_system::Config for Test { type BlockLength = (); type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; - type Index = u64; + type Nonce = u64; type BlockNumber = u64; type RuntimeCall = RuntimeCall; type Hash = H256; diff --git a/frame/remark/src/mock.rs b/frame/remark/src/mock.rs index 39f5d50ed28fd..68af41bd0f659 100644 --- a/frame/remark/src/mock.rs +++ b/frame/remark/src/mock.rs @@ -47,7 +47,7 @@ impl frame_system::Config for Test { type BlockLength = (); type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; - type Index = u64; + type Nonce = u64; type BlockNumber = u64; type Hash = H256; type Hashing = BlakeTwo256; diff --git a/frame/root-offences/src/mock.rs b/frame/root-offences/src/mock.rs index e48360ed34e24..4094651042916 100644 --- a/frame/root-offences/src/mock.rs +++ b/frame/root-offences/src/mock.rs @@ -90,7 +90,7 @@ impl frame_system::Config for Test { type BlockLength = (); type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; - type Index = u64; + type Nonce = u64; type BlockNumber = u64; type Hash = H256; type RuntimeCall = RuntimeCall; diff --git a/frame/salary/src/tests.rs b/frame/salary/src/tests.rs index 1b7bc6cbb6df5..c5e913c2aa86f 100644 --- a/frame/salary/src/tests.rs +++ b/frame/salary/src/tests.rs @@ -60,7 +60,7 @@ impl frame_system::Config for Test { type BlockLength = (); type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; - type Index = u64; + type Nonce = u64; type BlockNumber = u64; type RuntimeCall = RuntimeCall; type Hash = H256; diff --git a/frame/scheduler/src/mock.rs b/frame/scheduler/src/mock.rs index adb54fd78b181..8ee723758c2b7 100644 --- a/frame/scheduler/src/mock.rs +++ b/frame/scheduler/src/mock.rs @@ -130,7 +130,7 @@ impl system::Config for Test { type DbWeight = RocksDbWeight; type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; - type Index = u64; + type Nonce = u64; type BlockNumber = u64; type Hash = H256; type Hashing = BlakeTwo256; diff --git a/frame/scored-pool/src/mock.rs b/frame/scored-pool/src/mock.rs index f10a1320ef83c..65a7e3cd991ee 100644 --- a/frame/scored-pool/src/mock.rs +++ b/frame/scored-pool/src/mock.rs @@ -60,7 +60,7 @@ impl frame_system::Config for Test { type BlockLength = (); type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; - type Index = u64; + type Nonce = u64; type BlockNumber = u64; type Hash = H256; type RuntimeCall = RuntimeCall; diff --git a/frame/session/benchmarking/src/mock.rs b/frame/session/benchmarking/src/mock.rs index b7671255f68fb..d1eb7043e9d03 100644 --- a/frame/session/benchmarking/src/mock.rs +++ b/frame/session/benchmarking/src/mock.rs @@ -27,7 +27,7 @@ use frame_support::{ use sp_runtime::traits::IdentityLookup; type AccountId = u64; -type AccountIndex = u32; +type AccountNonce = u32; type BlockNumber = u64; type Balance = u64; @@ -53,7 +53,7 @@ impl frame_system::Config for Test { type BlockLength = (); type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; - type Index = AccountIndex; + type Nonce = AccountNonce; type BlockNumber = BlockNumber; type RuntimeCall = RuntimeCall; type Hash = sp_core::H256; diff --git a/frame/session/src/mock.rs b/frame/session/src/mock.rs index d6b8d9e207e02..c7fc15c41c727 100644 --- a/frame/session/src/mock.rs +++ b/frame/session/src/mock.rs @@ -244,7 +244,7 @@ impl frame_system::Config for Test { type BlockLength = (); type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; - type Index = u64; + type Nonce = u64; type BlockNumber = u64; type RuntimeCall = RuntimeCall; type Hash = H256; diff --git a/frame/society/src/mock.rs b/frame/society/src/mock.rs index 9f72febc2106e..b199a4af1adfb 100644 --- a/frame/society/src/mock.rs +++ b/frame/society/src/mock.rs @@ -62,7 +62,7 @@ impl frame_system::Config for Test { type BlockLength = (); type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; - type Index = u64; + type Nonce = u64; type BlockNumber = u64; type Hash = H256; type RuntimeCall = RuntimeCall; diff --git a/frame/staking/src/mock.rs b/frame/staking/src/mock.rs index 98b58010a2434..e2754f7835710 100644 --- a/frame/staking/src/mock.rs +++ b/frame/staking/src/mock.rs @@ -42,7 +42,7 @@ pub const BLOCK_TIME: u64 = 1000; /// The AccountId alias in this test module. pub(crate) type AccountId = u64; -pub(crate) type AccountIndex = u64; +pub(crate) type AccountNonce = u64; pub(crate) type BlockNumber = u64; pub(crate) type Balance = u128; @@ -127,7 +127,7 @@ impl frame_system::Config for Test { type BlockLength = (); type DbWeight = RocksDbWeight; type RuntimeOrigin = RuntimeOrigin; - type Index = AccountIndex; + type Nonce = AccountNonce; type BlockNumber = BlockNumber; type RuntimeCall = RuntimeCall; type Hash = H256; diff --git a/frame/state-trie-migration/src/lib.rs b/frame/state-trie-migration/src/lib.rs index 1f6266d999825..3fe316ef14365 100644 --- a/frame/state-trie-migration/src/lib.rs +++ b/frame/state-trie-migration/src/lib.rs @@ -1091,7 +1091,7 @@ mod mock { type BlockLength = (); type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; - type Index = u64; + type Nonce = u64; type BlockNumber = u32; type Hash = H256; type Hashing = BlakeTwo256; diff --git a/frame/statement/src/mock.rs b/frame/statement/src/mock.rs index f4d9360c9a6c0..55f642615c390 100644 --- a/frame/statement/src/mock.rs +++ b/frame/statement/src/mock.rs @@ -59,7 +59,7 @@ impl frame_system::Config for Test { type DbWeight = RocksDbWeight; type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; - type Index = u64; + type Nonce = u64; type BlockNumber = u64; type Hash = H256; type Hashing = BlakeTwo256; diff --git a/frame/sudo/src/mock.rs b/frame/sudo/src/mock.rs index 95a6507c12dd5..5f5bc0479d189 100644 --- a/frame/sudo/src/mock.rs +++ b/frame/sudo/src/mock.rs @@ -119,7 +119,7 @@ impl frame_system::Config for Test { type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; - type Index = u64; + type Nonce = u64; type BlockNumber = u64; type Hash = H256; type Hashing = BlakeTwo256; diff --git a/frame/support/test/compile_pass/src/lib.rs b/frame/support/test/compile_pass/src/lib.rs index 4eaa657b1e486..2f2f1ea3cfcb7 100644 --- a/frame/support/test/compile_pass/src/lib.rs +++ b/frame/support/test/compile_pass/src/lib.rs @@ -45,7 +45,6 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { pub type Signature = sr25519::Signature; pub type AccountId = ::Signer; pub type BlockNumber = u64; -pub type Index = u64; parameter_types! { pub const Version: RuntimeVersion = VERSION; @@ -55,7 +54,7 @@ impl frame_system::Config for Runtime { type BaseCallFilter = Everything; type BlockWeights = (); type BlockLength = (); - type Index = u128; + type Nonce = u128; type Hash = H256; type Hashing = BlakeTwo256; type Header = Header; diff --git a/frame/support/test/tests/construct_runtime_ui/no_std_genesis_config.rs b/frame/support/test/tests/construct_runtime_ui/no_std_genesis_config.rs index 9c9c49c4b2740..fae52787e4cba 100644 --- a/frame/support/test/tests/construct_runtime_ui/no_std_genesis_config.rs +++ b/frame/support/test/tests/construct_runtime_ui/no_std_genesis_config.rs @@ -1,6 +1,6 @@ use frame_support::construct_runtime; -use sp_runtime::{generic, traits::BlakeTwo256}; use sp_core::sr25519; +use sp_runtime::{generic, traits::BlakeTwo256}; pub type Signature = sr25519::Signature; pub type BlockNumber = u32; @@ -13,7 +13,7 @@ impl test_pallet::Config for Runtime {} impl frame_system::Config for Runtime { type BaseCallFilter = frame_support::traits::Everything; type RuntimeOrigin = RuntimeOrigin; - type Index = u64; + type Nonce = u64; type BlockNumber = u32; type RuntimeCall = RuntimeCall; type Hash = sp_runtime::testing::H256; diff --git a/frame/support/test/tests/construct_runtime_ui/number_of_pallets_exceeds_tuple_size.rs b/frame/support/test/tests/construct_runtime_ui/number_of_pallets_exceeds_tuple_size.rs index 5dfc67c83836a..2522cf2e53fc9 100644 --- a/frame/support/test/tests/construct_runtime_ui/number_of_pallets_exceeds_tuple_size.rs +++ b/frame/support/test/tests/construct_runtime_ui/number_of_pallets_exceeds_tuple_size.rs @@ -22,7 +22,7 @@ impl pallet::Config for Runtime {} impl frame_system::Config for Runtime { type BaseCallFilter = frame_support::traits::Everything; type RuntimeOrigin = RuntimeOrigin; - type Index = u64; + type Nonce = u64; type BlockNumber = u32; type RuntimeCall = RuntimeCall; type Hash = sp_runtime::testing::H256; diff --git a/frame/support/test/tests/construct_runtime_ui/pallet_error_too_large.rs b/frame/support/test/tests/construct_runtime_ui/pallet_error_too_large.rs index 866c3f0de6c3c..d60819c3915a2 100644 --- a/frame/support/test/tests/construct_runtime_ui/pallet_error_too_large.rs +++ b/frame/support/test/tests/construct_runtime_ui/pallet_error_too_large.rs @@ -1,6 +1,6 @@ use frame_support::construct_runtime; -use sp_runtime::{generic, traits::BlakeTwo256}; use sp_core::sr25519; +use sp_runtime::{generic, traits::BlakeTwo256}; #[frame_support::pallet] mod pallet { @@ -18,22 +18,22 @@ mod pallet { #[derive(scale_info::TypeInfo, frame_support::PalletError, codec::Encode, codec::Decode)] pub enum Nested1 { - Nested2(Nested2) + Nested2(Nested2), } #[derive(scale_info::TypeInfo, frame_support::PalletError, codec::Encode, codec::Decode)] pub enum Nested2 { - Nested3(Nested3) + Nested3(Nested3), } #[derive(scale_info::TypeInfo, frame_support::PalletError, codec::Encode, codec::Decode)] pub enum Nested3 { - Nested4(Nested4) + Nested4(Nested4), } #[derive(scale_info::TypeInfo, frame_support::PalletError, codec::Encode, codec::Decode)] pub enum Nested4 { - Num(u8) + Num(u8), } pub type Signature = sr25519::Signature; @@ -47,7 +47,7 @@ impl pallet::Config for Runtime {} impl frame_system::Config for Runtime { type BaseCallFilter = frame_support::traits::Everything; type RuntimeOrigin = RuntimeOrigin; - type Index = u64; + type Nonce = u64; type BlockNumber = u32; type RuntimeCall = RuntimeCall; type Hash = sp_runtime::testing::H256; diff --git a/frame/support/test/tests/construct_runtime_ui/undefined_call_part.rs b/frame/support/test/tests/construct_runtime_ui/undefined_call_part.rs index 0010f5277bb40..a5c812e1d1190 100644 --- a/frame/support/test/tests/construct_runtime_ui/undefined_call_part.rs +++ b/frame/support/test/tests/construct_runtime_ui/undefined_call_part.rs @@ -1,6 +1,6 @@ use frame_support::construct_runtime; -use sp_runtime::{generic, traits::BlakeTwo256}; use sp_core::sr25519; +use sp_runtime::{generic, traits::BlakeTwo256}; #[frame_support::pallet] mod pallet { @@ -22,7 +22,7 @@ impl pallet::Config for Runtime {} impl frame_system::Config for Runtime { type BaseCallFilter = frame_support::traits::Everything; type RuntimeOrigin = RuntimeOrigin; - type Index = u64; + type Nonce = u64; type BlockNumber = u32; type RuntimeCall = RuntimeCall; type Hash = sp_runtime::testing::H256; diff --git a/frame/support/test/tests/construct_runtime_ui/undefined_event_part.rs b/frame/support/test/tests/construct_runtime_ui/undefined_event_part.rs index 35212df8f457c..4ff90444dcc07 100644 --- a/frame/support/test/tests/construct_runtime_ui/undefined_event_part.rs +++ b/frame/support/test/tests/construct_runtime_ui/undefined_event_part.rs @@ -1,6 +1,6 @@ use frame_support::construct_runtime; -use sp_runtime::{generic, traits::BlakeTwo256}; use sp_core::sr25519; +use sp_runtime::{generic, traits::BlakeTwo256}; #[frame_support::pallet] mod pallet { @@ -22,7 +22,7 @@ impl pallet::Config for Runtime {} impl frame_system::Config for Runtime { type BaseCallFilter = frame_support::traits::Everything; type RuntimeOrigin = RuntimeOrigin; - type Index = u64; + type Nonce = u64; type BlockNumber = u32; type RuntimeCall = RuntimeCall; type Hash = sp_runtime::testing::H256; diff --git a/frame/support/test/tests/construct_runtime_ui/undefined_genesis_config_part.rs b/frame/support/test/tests/construct_runtime_ui/undefined_genesis_config_part.rs index ec753e9a03129..14e9f79da12a1 100644 --- a/frame/support/test/tests/construct_runtime_ui/undefined_genesis_config_part.rs +++ b/frame/support/test/tests/construct_runtime_ui/undefined_genesis_config_part.rs @@ -1,6 +1,6 @@ use frame_support::construct_runtime; -use sp_runtime::{generic, traits::BlakeTwo256}; use sp_core::sr25519; +use sp_runtime::{generic, traits::BlakeTwo256}; #[frame_support::pallet] mod pallet { @@ -22,7 +22,7 @@ impl pallet::Config for Runtime {} impl frame_system::Config for Runtime { type BaseCallFilter = frame_support::traits::Everything; type RuntimeOrigin = RuntimeOrigin; - type Index = u64; + type Nonce = u64; type BlockNumber = u32; type RuntimeCall = RuntimeCall; type Hash = sp_runtime::testing::H256; diff --git a/frame/support/test/tests/construct_runtime_ui/undefined_inherent_part.rs b/frame/support/test/tests/construct_runtime_ui/undefined_inherent_part.rs index 22eaccca42d97..95ae9ca4f3abc 100644 --- a/frame/support/test/tests/construct_runtime_ui/undefined_inherent_part.rs +++ b/frame/support/test/tests/construct_runtime_ui/undefined_inherent_part.rs @@ -1,6 +1,6 @@ use frame_support::construct_runtime; -use sp_runtime::{generic, traits::BlakeTwo256}; use sp_core::sr25519; +use sp_runtime::{generic, traits::BlakeTwo256}; #[frame_support::pallet] mod pallet { @@ -22,7 +22,7 @@ impl pallet::Config for Runtime {} impl frame_system::Config for Runtime { type BaseCallFilter = frame_support::traits::Everything; type RuntimeOrigin = RuntimeOrigin; - type Index = u64; + type Nonce = u64; type BlockNumber = u32; type RuntimeCall = RuntimeCall; type Hash = sp_runtime::testing::H256; diff --git a/frame/support/test/tests/construct_runtime_ui/undefined_origin_part.rs b/frame/support/test/tests/construct_runtime_ui/undefined_origin_part.rs index 1705fff49dda8..aeb81067c399b 100644 --- a/frame/support/test/tests/construct_runtime_ui/undefined_origin_part.rs +++ b/frame/support/test/tests/construct_runtime_ui/undefined_origin_part.rs @@ -1,6 +1,6 @@ use frame_support::construct_runtime; -use sp_runtime::{generic, traits::BlakeTwo256}; use sp_core::sr25519; +use sp_runtime::{generic, traits::BlakeTwo256}; #[frame_support::pallet] mod pallet { @@ -22,7 +22,7 @@ impl pallet::Config for Runtime {} impl frame_system::Config for Runtime { type BaseCallFilter = frame_support::traits::Everything; type RuntimeOrigin = RuntimeOrigin; - type Index = u64; + type Nonce = u64; type BlockNumber = u32; type RuntimeCall = RuntimeCall; type Hash = sp_runtime::testing::H256; diff --git a/frame/support/test/tests/construct_runtime_ui/undefined_validate_unsigned_part.rs b/frame/support/test/tests/construct_runtime_ui/undefined_validate_unsigned_part.rs index 8f64d30940725..f98c9373cb7e4 100644 --- a/frame/support/test/tests/construct_runtime_ui/undefined_validate_unsigned_part.rs +++ b/frame/support/test/tests/construct_runtime_ui/undefined_validate_unsigned_part.rs @@ -1,6 +1,6 @@ use frame_support::construct_runtime; -use sp_runtime::{generic, traits::BlakeTwo256}; use sp_core::sr25519; +use sp_runtime::{generic, traits::BlakeTwo256}; #[frame_support::pallet] mod pallet { @@ -22,7 +22,7 @@ impl pallet::Config for Runtime {} impl frame_system::Config for Runtime { type BaseCallFilter = frame_support::traits::Everything; type RuntimeOrigin = RuntimeOrigin; - type Index = u64; + type Nonce = u64; type BlockNumber = u32; type RuntimeCall = RuntimeCall; type Hash = sp_runtime::testing::H256; diff --git a/frame/support/test/tests/pallet.rs b/frame/support/test/tests/pallet.rs index f6b5858f113fa..99800b16886f6 100644 --- a/frame/support/test/tests/pallet.rs +++ b/frame/support/test/tests/pallet.rs @@ -648,7 +648,7 @@ frame_support::parameter_types!( impl frame_system::Config for Runtime { type BaseCallFilter = frame_support::traits::Everything; type RuntimeOrigin = RuntimeOrigin; - type Index = u64; + type Nonce = u64; type BlockNumber = u32; type RuntimeCall = RuntimeCall; type Hash = sp_runtime::testing::H256; diff --git a/frame/support/test/tests/pallet_instance.rs b/frame/support/test/tests/pallet_instance.rs index 0747753289af0..67ac88ad50d9f 100644 --- a/frame/support/test/tests/pallet_instance.rs +++ b/frame/support/test/tests/pallet_instance.rs @@ -289,7 +289,7 @@ pub mod pallet2 { impl frame_system::Config for Runtime { type BaseCallFilter = frame_support::traits::Everything; type RuntimeOrigin = RuntimeOrigin; - type Index = u64; + type Nonce = u64; type BlockNumber = u32; type RuntimeCall = RuntimeCall; type Hash = sp_runtime::testing::H256; diff --git a/frame/support/test/tests/pallet_ui/pallet_doc_arg_non_path.rs b/frame/support/test/tests/pallet_ui/pallet_doc_arg_non_path.rs index ef3097d23007d..32df5d6183653 100644 --- a/frame/support/test/tests/pallet_ui/pallet_doc_arg_non_path.rs +++ b/frame/support/test/tests/pallet_ui/pallet_doc_arg_non_path.rs @@ -5,7 +5,7 @@ mod pallet { #[pallet::config] pub trait Config: frame_system::Config where - ::Index: From, + ::Nonce: From, { } diff --git a/frame/support/test/tests/pallet_ui/pallet_doc_empty.rs b/frame/support/test/tests/pallet_ui/pallet_doc_empty.rs index fe40806d2fa75..6ff01e9fb44b8 100644 --- a/frame/support/test/tests/pallet_ui/pallet_doc_empty.rs +++ b/frame/support/test/tests/pallet_ui/pallet_doc_empty.rs @@ -5,7 +5,7 @@ mod pallet { #[pallet::config] pub trait Config: frame_system::Config where - ::Index: From, + ::Nonce: From, { } diff --git a/frame/support/test/tests/pallet_ui/pallet_doc_invalid_arg.rs b/frame/support/test/tests/pallet_ui/pallet_doc_invalid_arg.rs index 8f0ccb3777a49..c7d3b556a08e2 100644 --- a/frame/support/test/tests/pallet_ui/pallet_doc_invalid_arg.rs +++ b/frame/support/test/tests/pallet_ui/pallet_doc_invalid_arg.rs @@ -5,7 +5,7 @@ mod pallet { #[pallet::config] pub trait Config: frame_system::Config where - ::Index: From, + ::Nonce: From, { } diff --git a/frame/support/test/tests/pallet_ui/pallet_doc_multiple_args.rs b/frame/support/test/tests/pallet_ui/pallet_doc_multiple_args.rs index ffbed9d950799..a799879fe4442 100644 --- a/frame/support/test/tests/pallet_ui/pallet_doc_multiple_args.rs +++ b/frame/support/test/tests/pallet_ui/pallet_doc_multiple_args.rs @@ -5,7 +5,7 @@ mod pallet { #[pallet::config] pub trait Config: frame_system::Config where - ::Index: From, + ::Nonce: From, { } diff --git a/frame/support/test/tests/pallet_ui/pass/dev_mode_valid.rs b/frame/support/test/tests/pallet_ui/pass/dev_mode_valid.rs index 28b901213943c..9680f953457a3 100644 --- a/frame/support/test/tests/pallet_ui/pass/dev_mode_valid.rs +++ b/frame/support/test/tests/pallet_ui/pass/dev_mode_valid.rs @@ -1,10 +1,6 @@ #![cfg_attr(not(feature = "std"), no_std)] -use frame_support::{ - traits::{ - ConstU32, - }, -}; +use frame_support::traits::ConstU32; pub use pallet::*; @@ -60,7 +56,7 @@ pub mod pallet { impl frame_system::Config for Runtime { type BaseCallFilter = frame_support::traits::Everything; type RuntimeOrigin = RuntimeOrigin; - type Index = u64; + type Nonce = u64; type BlockNumber = u32; type RuntimeCall = RuntimeCall; type Hash = sp_runtime::testing::H256; @@ -100,17 +96,15 @@ frame_support::construct_runtime!( } ); -impl pallet::Config for Runtime { - -} +impl pallet::Config for Runtime {} fn main() { - use frame_support::{pallet_prelude::*}; - use storage::unhashed; + use frame_support::pallet_prelude::*; use sp_io::{ hashing::{blake2_128, twox_128}, TestExternalities, }; + use storage::unhashed; fn blake2_128_concat(d: &[u8]) -> Vec { let mut v = blake2_128(d).to_vec(); diff --git a/frame/support/test/tests/pallet_ui/pass/where_clause_missing_hooks.rs b/frame/support/test/tests/pallet_ui/pass/where_clause_missing_hooks.rs index bf5f22306207a..15fff372a1dd1 100644 --- a/frame/support/test/tests/pallet_ui/pass/where_clause_missing_hooks.rs +++ b/frame/support/test/tests/pallet_ui/pass/where_clause_missing_hooks.rs @@ -1,17 +1,24 @@ #[frame_support::pallet] mod pallet { #[pallet::config] - pub trait Config: frame_system::Config where ::Index: From {} + pub trait Config: frame_system::Config + where + ::Nonce: From, + { + } #[pallet::pallet] pub struct Pallet(core::marker::PhantomData); #[pallet::call] - impl Pallet where ::Index: From {} + impl Pallet where ::Nonce: From {} - impl Pallet where ::Index: From { + impl Pallet + where + ::Nonce: From, + { fn foo(x: u128) { - let _index = ::Index::from(x); + let _index = ::Nonce::from(x); } } } diff --git a/frame/support/test/tests/runtime_metadata.rs b/frame/support/test/tests/runtime_metadata.rs index 70ca307d4428c..d501e1b7e30d6 100644 --- a/frame/support/test/tests/runtime_metadata.rs +++ b/frame/support/test/tests/runtime_metadata.rs @@ -25,7 +25,6 @@ use scale_info::{form::MetaForm, meta_type}; use sp_runtime::traits::Block as BlockT; pub type BlockNumber = u64; -pub type Index = u64; pub type Header = sp_runtime::generic::Header; pub type Block = sp_runtime::generic::Block; pub type UncheckedExtrinsic = sp_runtime::generic::UncheckedExtrinsic; @@ -36,7 +35,7 @@ impl frame_system::Config for Runtime { type DbWeight = (); type BaseCallFilter = frame_support::traits::Everything; type RuntimeOrigin = RuntimeOrigin; - type Index = u64; + type Nonce = u64; type BlockNumber = u32; type RuntimeCall = RuntimeCall; type Hash = sp_runtime::testing::H256; diff --git a/frame/support/test/tests/storage_layers.rs b/frame/support/test/tests/storage_layers.rs index 3e306834869bb..8aaefb65dc584 100644 --- a/frame/support/test/tests/storage_layers.rs +++ b/frame/support/test/tests/storage_layers.rs @@ -58,7 +58,7 @@ pub mod pallet { } pub type BlockNumber = u32; -pub type Index = u64; +pub type Nonce = u64; pub type AccountId = u64; pub type Header = sp_runtime::generic::Header; pub type UncheckedExtrinsic = sp_runtime::generic::UncheckedExtrinsic; @@ -70,7 +70,7 @@ impl frame_system::Config for Runtime { type BlockLength = (); type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; - type Index = Index; + type Nonce = Nonce; type BlockNumber = BlockNumber; type Hash = sp_runtime::testing::H256; type Hashing = sp_runtime::traits::BlakeTwo256; diff --git a/frame/system/src/lib.rs b/frame/system/src/lib.rs index cdce897dcebce..c400b854508b4 100644 --- a/frame/system/src/lib.rs +++ b/frame/system/src/lib.rs @@ -240,16 +240,6 @@ pub mod pallet { + Copy + MaxEncodedLen; - type Index: Parameter - + Member - + MaybeSerializeDeserialize - + Debug - + Default - + MaybeDisplay - + AtLeast32Bit - + Copy - + MaxEncodedLen; - /// The block number type used by the runtime. type BlockNumber: Parameter + Member diff --git a/frame/timestamp/src/mock.rs b/frame/timestamp/src/mock.rs index 6f681788236c3..386fbbbc7a185 100644 --- a/frame/timestamp/src/mock.rs +++ b/frame/timestamp/src/mock.rs @@ -52,7 +52,7 @@ impl frame_system::Config for Test { type BlockLength = (); type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; - type Index = u64; + type Nonce = u64; type BlockNumber = u64; type RuntimeCall = RuntimeCall; type Hash = H256; diff --git a/frame/tips/src/tests.rs b/frame/tips/src/tests.rs index b2d97de18312f..fecfb36e75044 100644 --- a/frame/tips/src/tests.rs +++ b/frame/tips/src/tests.rs @@ -66,7 +66,7 @@ impl frame_system::Config for Test { type BlockLength = (); type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; - type Index = u64; + type Nonce = u64; type BlockNumber = u64; type RuntimeCall = RuntimeCall; type Hash = H256; diff --git a/frame/transaction-payment/asset-tx-payment/src/mock.rs b/frame/transaction-payment/asset-tx-payment/src/mock.rs index be7baaf2b370e..8e041e43ec4da 100644 --- a/frame/transaction-payment/asset-tx-payment/src/mock.rs +++ b/frame/transaction-payment/asset-tx-payment/src/mock.rs @@ -85,7 +85,7 @@ impl frame_system::Config for Runtime { type BlockLength = (); type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; - type Index = u64; + type Nonce = u64; type BlockNumber = u64; type RuntimeCall = RuntimeCall; type Hash = H256; diff --git a/frame/transaction-payment/src/mock.rs b/frame/transaction-payment/src/mock.rs index 741f094481c38..0415b82ae64a6 100644 --- a/frame/transaction-payment/src/mock.rs +++ b/frame/transaction-payment/src/mock.rs @@ -82,7 +82,7 @@ impl frame_system::Config for Runtime { type BlockLength = (); type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; - type Index = u64; + type Nonce = u64; type BlockNumber = u64; type RuntimeCall = RuntimeCall; type Hash = H256; diff --git a/frame/transaction-storage/src/mock.rs b/frame/transaction-storage/src/mock.rs index 3a87d8eaea707..9089dd4253270 100644 --- a/frame/transaction-storage/src/mock.rs +++ b/frame/transaction-storage/src/mock.rs @@ -53,7 +53,7 @@ impl frame_system::Config for Test { type BlockLength = (); type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; - type Index = u64; + type Nonce = u64; type BlockNumber = u64; type Hash = H256; type Hashing = BlakeTwo256; diff --git a/frame/treasury/src/tests.rs b/frame/treasury/src/tests.rs index 67b21ff6252a8..939703efb81fb 100644 --- a/frame/treasury/src/tests.rs +++ b/frame/treasury/src/tests.rs @@ -60,7 +60,7 @@ impl frame_system::Config for Test { type BlockLength = (); type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; - type Index = u64; + type Nonce = u64; type BlockNumber = u64; type RuntimeCall = RuntimeCall; type Hash = H256; diff --git a/frame/uniques/src/mock.rs b/frame/uniques/src/mock.rs index bad393a489582..ebad7e42addfb 100644 --- a/frame/uniques/src/mock.rs +++ b/frame/uniques/src/mock.rs @@ -51,7 +51,7 @@ impl frame_system::Config for Test { type BlockLength = (); type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; - type Index = u64; + type Nonce = u64; type BlockNumber = u64; type Hash = H256; type Hashing = BlakeTwo256; diff --git a/frame/utility/src/tests.rs b/frame/utility/src/tests.rs index ecc78ae6b17b6..45c53004553ce 100644 --- a/frame/utility/src/tests.rs +++ b/frame/utility/src/tests.rs @@ -155,7 +155,7 @@ impl frame_system::Config for Test { type BlockLength = (); type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; - type Index = u64; + type Nonce = u64; type BlockNumber = u64; type Hash = H256; type RuntimeCall = RuntimeCall; diff --git a/frame/vesting/src/mock.rs b/frame/vesting/src/mock.rs index 1adb36b730b1a..f6c677c9b4b55 100644 --- a/frame/vesting/src/mock.rs +++ b/frame/vesting/src/mock.rs @@ -57,7 +57,7 @@ impl frame_system::Config for Test { type Hash = H256; type Hashing = BlakeTwo256; type Header = Header; - type Index = u64; + type Nonce = u64; type Lookup = IdentityLookup; type OnKilledAccount = (); type OnNewAccount = (); diff --git a/frame/whitelist/src/mock.rs b/frame/whitelist/src/mock.rs index d644cd661ec9f..0ae709a660a8e 100644 --- a/frame/whitelist/src/mock.rs +++ b/frame/whitelist/src/mock.rs @@ -55,7 +55,7 @@ impl frame_system::Config for Test { type BlockLength = (); type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; - type Index = u64; + type Nonce = u64; type BlockNumber = u64; type Hash = H256; type RuntimeCall = RuntimeCall; diff --git a/primitives/api/proc-macro/src/runtime_metadata.rs b/primitives/api/proc-macro/src/runtime_metadata.rs index ae78fb52dbd5a..7bf146883be7f 100644 --- a/primitives/api/proc-macro/src/runtime_metadata.rs +++ b/primitives/api/proc-macro/src/runtime_metadata.rs @@ -30,13 +30,13 @@ use crate::{ /// Get the type parameter argument without lifetime or mutability /// of a runtime metadata function. /// -/// In the following example, both the `AccountId` and `Index` generic +/// In the following example, both the `AccountId` and `Nonce` generic /// type parameters must implement `scale_info::TypeInfo` because they /// are added into the metadata using `scale_info::meta_type`. /// /// ```ignore -/// trait ExampleAccountNonceApi { -/// fn account_nonce<'a>(account: &'a AccountId) -> Index; +/// trait ExampleAccountNonceApi { +/// fn account_nonce<'a>(account: &'a AccountId) -> Nonce; /// } /// ``` /// diff --git a/primitives/test-primitives/src/lib.rs b/primitives/test-primitives/src/lib.rs index 913cb762d92a5..82bdb6967b842 100644 --- a/primitives/test-primitives/src/lib.rs +++ b/primitives/test-primitives/src/lib.rs @@ -71,7 +71,7 @@ pub type Hash = H256; /// The block number type used in this runtime. pub type BlockNumber = u64; /// Index of a transaction. -pub type Index = u64; +pub type Nonce = u64; /// The item of a block digest. pub type DigestItem = sp_runtime::generic::DigestItem; /// The digest of a block. diff --git a/test-utils/runtime/src/extrinsic.rs b/test-utils/runtime/src/extrinsic.rs index a6e13226face0..05ffb7db5d5b9 100644 --- a/test-utils/runtime/src/extrinsic.rs +++ b/test-utils/runtime/src/extrinsic.rs @@ -19,7 +19,7 @@ use crate::{ substrate_test_pallet::pallet::Call as PalletCall, AccountId, Balance, BalancesCall, - CheckSubstrateCall, Extrinsic, Index, Pair, RuntimeCall, SignedPayload, TransferData, + CheckSubstrateCall, Extrinsic, Nonce, Pair, RuntimeCall, SignedPayload, TransferData, }; use codec::Encode; use frame_system::{CheckNonce, CheckWeight}; @@ -81,7 +81,7 @@ impl TryFrom<&Extrinsic> for TransferData { pub struct ExtrinsicBuilder { function: RuntimeCall, signer: Option, - nonce: Option, + nonce: Option, } impl ExtrinsicBuilder { @@ -176,7 +176,7 @@ impl ExtrinsicBuilder { } /// Given `nonce` will be set in `Extrinsic` - pub fn nonce(mut self, nonce: Index) -> Self { + pub fn nonce(mut self, nonce: Nonce) -> Self { self.nonce = Some(nonce); self } diff --git a/test-utils/runtime/src/lib.rs b/test-utils/runtime/src/lib.rs index ccb30614e0691..3133b174c1f4b 100644 --- a/test-utils/runtime/src/lib.rs +++ b/test-utils/runtime/src/lib.rs @@ -130,7 +130,7 @@ pub struct TransferData { pub from: AccountId, pub to: AccountId, pub amount: Balance, - pub nonce: Index, + pub nonce: Nonce, } /// The address format for describing accounts. @@ -156,7 +156,7 @@ pub type Hashing = BlakeTwo256; /// The block number type used in this runtime. pub type BlockNumber = u64; /// Index of a transaction. -pub type Index = u64; +pub type Nonce = u64; /// The item of a block digest. pub type DigestItem = sp_runtime::generic::DigestItem; /// The digest of a block. @@ -346,7 +346,7 @@ impl frame_system::pallet::Config for Runtime { type BlockLength = (); type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; - type Nonce = Index; + type Nonce = Nonce; type BlockNumber = BlockNumber; type Hash = H256; type Hashing = Hashing; @@ -528,8 +528,8 @@ impl_runtime_apis! { } } - impl frame_system_rpc_runtime_api::AccountNonceApi for Runtime { - fn account_nonce(account: AccountId) -> Index { + impl frame_system_rpc_runtime_api::AccountNonceApi for Runtime { + fn account_nonce(account: AccountId) -> Nonce { System::account_nonce(account) } } diff --git a/test-utils/runtime/transaction-pool/src/lib.rs b/test-utils/runtime/transaction-pool/src/lib.rs index 8e28449661650..7b52920044027 100644 --- a/test-utils/runtime/transaction-pool/src/lib.rs +++ b/test-utils/runtime/transaction-pool/src/lib.rs @@ -36,7 +36,7 @@ use sp_runtime::{ use std::collections::{BTreeMap, HashMap, HashSet}; use substrate_test_runtime_client::{ runtime::{ - AccountId, Block, BlockNumber, Extrinsic, ExtrinsicBuilder, Hash, Header, Index, Transfer, + AccountId, Block, BlockNumber, Extrinsic, ExtrinsicBuilder, Hash, Header, Nonce, Transfer, TransferData, }, AccountKeyring::{self, *}, @@ -377,7 +377,7 @@ impl sp_blockchain::HeaderMetadata for TestApi { /// Generate transfer extrinsic with a given nonce. /// /// Part of the test api. -pub fn uxt(who: AccountKeyring, nonce: Index) -> Extrinsic { +pub fn uxt(who: AccountKeyring, nonce: Nonce) -> Extrinsic { let dummy = codec::Decode::decode(&mut TrailingZeroInput::zeroes()).unwrap(); let transfer = Transfer { from: who.into(), to: dummy, nonce, amount: 1 }; ExtrinsicBuilder::new_transfer(transfer).build() diff --git a/utils/frame/rpc/support/src/lib.rs b/utils/frame/rpc/support/src/lib.rs index eecc80c408efd..9b1250c016c9e 100644 --- a/utils/frame/rpc/support/src/lib.rs +++ b/utils/frame/rpc/support/src/lib.rs @@ -58,7 +58,7 @@ use sp_storage::{StorageData, StorageKey}; /// # type BlockLength = (); /// # type RuntimeOrigin = RuntimeOrigin; /// # type RuntimeCall = RuntimeCall; -/// # type Index = u64; +/// # type Nonce = u64; /// # type BlockNumber = u64; /// # type Hash = Hash; /// # type Hashing = BlakeTwo256; diff --git a/utils/frame/rpc/system/src/lib.rs b/utils/frame/rpc/system/src/lib.rs index 26efa02970efe..1eff71e3390a3 100644 --- a/utils/frame/rpc/system/src/lib.rs +++ b/utils/frame/rpc/system/src/lib.rs @@ -38,14 +38,14 @@ pub use frame_system_rpc_runtime_api::AccountNonceApi; /// System RPC methods. #[rpc(client, server)] -pub trait SystemApi { +pub trait SystemApi { /// Returns the next valid index (aka nonce) for given account. /// /// This method takes into consideration all pending transactions /// currently in the pool and if no transactions are found in the pool /// it fallbacks to query the index from the runtime (aka. state nonce). #[method(name = "system_accountNextIndex", aliases = ["account_nextIndex"])] - async fn nonce(&self, account: AccountId) -> RpcResult; + async fn nonce(&self, account: AccountId) -> RpcResult; /// Dry run an extrinsic at a given block. Return SCALE encoded ApplyExtrinsicResult. #[method(name = "system_dryRun", aliases = ["system_dryRunAt"])] @@ -85,20 +85,20 @@ impl System { } #[async_trait] -impl - SystemApiServer<::Hash, AccountId, Index> for System +impl + SystemApiServer<::Hash, AccountId, Nonce> for System where C: sp_api::ProvideRuntimeApi, C: HeaderBackend, C: Send + Sync + 'static, - C::Api: AccountNonceApi, + C::Api: AccountNonceApi, C::Api: BlockBuilder, P: TransactionPool + 'static, Block: traits::Block, AccountId: Clone + Display + Codec + Send + 'static, - Index: Clone + Display + Codec + Send + traits::AtLeast32Bit + 'static, + Nonce: Clone + Display + Codec + Send + traits::AtLeast32Bit + 'static, { - async fn nonce(&self, account: AccountId) -> RpcResult { + async fn nonce(&self, account: AccountId) -> RpcResult { let api = self.client.runtime_api(); let best = self.client.info().best_hash; @@ -176,11 +176,11 @@ where /// Adjust account nonce from state, so that tx with the nonce will be /// placed after all ready txpool transactions. -fn adjust_nonce(pool: &P, account: AccountId, nonce: Index) -> Index +fn adjust_nonce(pool: &P, account: AccountId, nonce: Nonce) -> Nonce where P: TransactionPool, AccountId: Clone + std::fmt::Display + Encode, - Index: Clone + std::fmt::Display + Encode + traits::AtLeast32Bit + 'static, + Nonce: Clone + std::fmt::Display + Encode + traits::AtLeast32Bit + 'static, { log::debug!(target: "rpc", "State nonce for {}: {}", account, nonce); // Now we need to query the transaction pool From f8952d91f1688d3c26c451b8a63c88a2a52b91bb Mon Sep 17 00:00:00 2001 From: Juan Girini Date: Fri, 2 Jun 2023 12:07:45 +0200 Subject: [PATCH 08/11] wip --- bin/node/cli/benches/block_production.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/node/cli/benches/block_production.rs b/bin/node/cli/benches/block_production.rs index c1d5171d8ed9e..527b145c62c46 100644 --- a/bin/node/cli/benches/block_production.rs +++ b/bin/node/cli/benches/block_production.rs @@ -154,7 +154,7 @@ fn prepare_benchmark(client: &FullClient) -> (usize, Vec) { let src = Sr25519Keyring::Alice.pair(); let dst: MultiAddress = Sr25519Keyring::Bob.to_account_id().into(); - // Add as many transfer extrinsics as possible into a single block. + // Add as many tranfer extrinsics as possible into a single block. for nonce in 0.. { let extrinsic: OpaqueExtrinsic = create_extrinsic( client, From 10087f17f2cbff985208dd02bdfba82cf30a1877 Mon Sep 17 00:00:00 2001 From: Juan Girini Date: Fri, 2 Jun 2023 12:20:25 +0200 Subject: [PATCH 09/11] remove accountnonce in lieu of nonce --- frame/benchmarking/pov/src/benchmarking.rs | 4 ++-- frame/benchmarking/src/baseline.rs | 4 ++-- .../test-staking-e2e/src/mock.rs | 4 ++-- frame/fast-unstake/src/mock.rs | 4 ++-- frame/nomination-pools/benchmarking/src/mock.rs | 4 ++-- frame/nomination-pools/test-staking/src/mock.rs | 4 ++-- frame/offences/benchmarking/src/mock.rs | 4 ++-- frame/session/benchmarking/src/mock.rs | 4 ++-- frame/staking/src/mock.rs | 4 ++-- frame/system/benchmarking/src/mock.rs | 4 ++-- 10 files changed, 20 insertions(+), 20 deletions(-) diff --git a/frame/benchmarking/pov/src/benchmarking.rs b/frame/benchmarking/pov/src/benchmarking.rs index cb460ba787076..116b5e3251827 100644 --- a/frame/benchmarking/pov/src/benchmarking.rs +++ b/frame/benchmarking/pov/src/benchmarking.rs @@ -342,7 +342,7 @@ mod mock { use sp_runtime::testing::H256; type AccountId = u64; - type AccountNonce = u32; + type Nonce = u32; type BlockNumber = u64; type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; @@ -365,7 +365,7 @@ mod mock { type BlockLength = (); type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; - type Nonce = AccountNonce; + type Nonce = Nonce; type BlockNumber = BlockNumber; type RuntimeCall = RuntimeCall; type Hash = H256; diff --git a/frame/benchmarking/src/baseline.rs b/frame/benchmarking/src/baseline.rs index 1a33da4f0099e..68d845a86ad1f 100644 --- a/frame/benchmarking/src/baseline.rs +++ b/frame/benchmarking/src/baseline.rs @@ -114,7 +114,7 @@ pub mod mock { use sp_runtime::testing::H256; type AccountId = u64; - type AccountNonce = u32; + type Nonce = u32; type BlockNumber = u64; type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; @@ -136,7 +136,7 @@ pub mod mock { type BlockLength = (); type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; - type Nonce = AccountNonce; + type Nonce = Nonce; type BlockNumber = BlockNumber; type RuntimeCall = RuntimeCall; type Hash = H256; diff --git a/frame/election-provider-multi-phase/test-staking-e2e/src/mock.rs b/frame/election-provider-multi-phase/test-staking-e2e/src/mock.rs index c8191c6e6fae8..c9636f556daf4 100644 --- a/frame/election-provider-multi-phase/test-staking-e2e/src/mock.rs +++ b/frame/election-provider-multi-phase/test-staking-e2e/src/mock.rs @@ -71,7 +71,7 @@ frame_support::construct_runtime!( ); pub(crate) type AccountId = u128; -pub(crate) type AccountNonce = u32; +pub(crate) type Nonce = u32; pub(crate) type BlockNumber = u64; pub(crate) type Balance = u64; pub(crate) type VoterIndex = u32; @@ -84,7 +84,7 @@ impl frame_system::Config for Runtime { type BlockLength = (); type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; - type Nonce = AccountNonce; + type Nonce = Nonce; type BlockNumber = BlockNumber; type RuntimeCall = RuntimeCall; type Hash = H256; diff --git a/frame/fast-unstake/src/mock.rs b/frame/fast-unstake/src/mock.rs index 58fee8a87d75e..e8b78eb6978bd 100644 --- a/frame/fast-unstake/src/mock.rs +++ b/frame/fast-unstake/src/mock.rs @@ -29,7 +29,7 @@ use pallet_staking::{Exposure, IndividualExposure, StakerStatus}; use sp_std::prelude::*; pub type AccountId = u128; -pub type AccountNonce = u32; +pub type Nonce = u32; pub type BlockNumber = u64; pub type Balance = u128; pub type T = Runtime; @@ -47,7 +47,7 @@ impl frame_system::Config for Runtime { type BlockLength = (); type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; - type Nonce = AccountNonce; + type Nonce = Nonce; type BlockNumber = BlockNumber; type RuntimeCall = RuntimeCall; type Hash = sp_core::H256; diff --git a/frame/nomination-pools/benchmarking/src/mock.rs b/frame/nomination-pools/benchmarking/src/mock.rs index ce5b908590f06..5f28f57c2c3a3 100644 --- a/frame/nomination-pools/benchmarking/src/mock.rs +++ b/frame/nomination-pools/benchmarking/src/mock.rs @@ -24,7 +24,7 @@ use sp_runtime::{ }; type AccountId = u128; -type AccountNonce = u32; +type Nonce = u32; type BlockNumber = u64; type Balance = u128; @@ -34,7 +34,7 @@ impl frame_system::Config for Runtime { type BlockLength = (); type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; - type Nonce = AccountNonce; + type Nonce = Nonce; type BlockNumber = BlockNumber; type RuntimeCall = RuntimeCall; type Hash = sp_core::H256; diff --git a/frame/nomination-pools/test-staking/src/mock.rs b/frame/nomination-pools/test-staking/src/mock.rs index bee2c5db292f7..da507960b0c69 100644 --- a/frame/nomination-pools/test-staking/src/mock.rs +++ b/frame/nomination-pools/test-staking/src/mock.rs @@ -29,7 +29,7 @@ use sp_runtime::{ }; type AccountId = u128; -type AccountNonce = u32; +type Nonce = u32; type BlockNumber = u64; type Balance = u128; @@ -44,7 +44,7 @@ impl frame_system::Config for Runtime { type BlockLength = (); type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; - type Nonce = AccountNonce; + type Nonce = Nonce; type BlockNumber = BlockNumber; type RuntimeCall = RuntimeCall; type Hash = sp_core::H256; diff --git a/frame/offences/benchmarking/src/mock.rs b/frame/offences/benchmarking/src/mock.rs index 866a81a4c910c..a422ecf2bbd97 100644 --- a/frame/offences/benchmarking/src/mock.rs +++ b/frame/offences/benchmarking/src/mock.rs @@ -33,7 +33,7 @@ use sp_runtime::{ }; type AccountId = u64; -type AccountNonce = u32; +type Nonce = u32; type BlockNumber = u64; type Balance = u64; @@ -43,7 +43,7 @@ impl frame_system::Config for Test { type BlockLength = (); type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; - type Nonce = AccountNonce; + type Nonce = Nonce; type BlockNumber = BlockNumber; type RuntimeCall = RuntimeCall; type Hash = sp_core::H256; diff --git a/frame/session/benchmarking/src/mock.rs b/frame/session/benchmarking/src/mock.rs index d1eb7043e9d03..7f02f9d4e05ef 100644 --- a/frame/session/benchmarking/src/mock.rs +++ b/frame/session/benchmarking/src/mock.rs @@ -27,7 +27,7 @@ use frame_support::{ use sp_runtime::traits::IdentityLookup; type AccountId = u64; -type AccountNonce = u32; +type Nonce = u32; type BlockNumber = u64; type Balance = u64; @@ -53,7 +53,7 @@ impl frame_system::Config for Test { type BlockLength = (); type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; - type Nonce = AccountNonce; + type Nonce = Nonce; type BlockNumber = BlockNumber; type RuntimeCall = RuntimeCall; type Hash = sp_core::H256; diff --git a/frame/staking/src/mock.rs b/frame/staking/src/mock.rs index e2754f7835710..c9d3459a2252d 100644 --- a/frame/staking/src/mock.rs +++ b/frame/staking/src/mock.rs @@ -42,7 +42,7 @@ pub const BLOCK_TIME: u64 = 1000; /// The AccountId alias in this test module. pub(crate) type AccountId = u64; -pub(crate) type AccountNonce = u64; +pub(crate) type Nonce = u64; pub(crate) type BlockNumber = u64; pub(crate) type Balance = u128; @@ -127,7 +127,7 @@ impl frame_system::Config for Test { type BlockLength = (); type DbWeight = RocksDbWeight; type RuntimeOrigin = RuntimeOrigin; - type Nonce = AccountNonce; + type Nonce = Nonce; type BlockNumber = BlockNumber; type RuntimeCall = RuntimeCall; type Hash = H256; diff --git a/frame/system/benchmarking/src/mock.rs b/frame/system/benchmarking/src/mock.rs index fba4a2714c061..c5ee9327c36eb 100644 --- a/frame/system/benchmarking/src/mock.rs +++ b/frame/system/benchmarking/src/mock.rs @@ -23,7 +23,7 @@ use codec::Encode; use sp_runtime::traits::IdentityLookup; type AccountId = u64; -type AccountNonce = u32; +type Nonce = u32; type BlockNumber = u64; type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; @@ -45,7 +45,7 @@ impl frame_system::Config for Test { type BlockLength = (); type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; - type Nonce = AccountNonce; + type Nonce = Nonce; type BlockNumber = BlockNumber; type RuntimeCall = RuntimeCall; type Hash = sp_core::H256; From a52753b72ba9c8fda2970606be20bd1fd6ce2a1d Mon Sep 17 00:00:00 2001 From: Juan Girini Date: Fri, 2 Jun 2023 12:55:16 +0200 Subject: [PATCH 10/11] add minor improvement --- frame/election-provider-support/src/onchain.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frame/election-provider-support/src/onchain.rs b/frame/election-provider-support/src/onchain.rs index 5af021452e841..42531d0c70714 100644 --- a/frame/election-provider-support/src/onchain.rs +++ b/frame/election-provider-support/src/onchain.rs @@ -190,6 +190,7 @@ mod tests { use sp_npos_elections::Support; use sp_runtime::Perbill; type AccountId = u64; + type Nonce = u64; type BlockNumber = u64; pub type Header = sp_runtime::generic::Header; @@ -210,7 +211,7 @@ mod tests { type SS58Prefix = (); type BaseCallFilter = frame_support::traits::Everything; type RuntimeOrigin = RuntimeOrigin; - type Nonce = AccountId; + type Nonce = Nonce; type BlockNumber = BlockNumber; type RuntimeCall = RuntimeCall; type Hash = sp_core::H256; From f3b7522ea8a72a972838e824cb7c4a83b92fc80e Mon Sep 17 00:00:00 2001 From: Juan Girini Date: Thu, 13 Jul 2023 16:08:00 +0200 Subject: [PATCH 11/11] rebase and merge conflicts --- .../transaction-payment/asset-conversion-tx-payment/src/mock.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frame/transaction-payment/asset-conversion-tx-payment/src/mock.rs b/frame/transaction-payment/asset-conversion-tx-payment/src/mock.rs index 683b93ad1f3fe..bfbe8b4178cee 100644 --- a/frame/transaction-payment/asset-conversion-tx-payment/src/mock.rs +++ b/frame/transaction-payment/asset-conversion-tx-payment/src/mock.rs @@ -84,7 +84,7 @@ impl frame_system::Config for Runtime { type BlockLength = (); type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; - type Index = u64; + type Nonce = u64; type RuntimeCall = RuntimeCall; type Hash = H256; type Hashing = BlakeTwo256;