Replace Index for Nonce (#7374)

* replace Index for Nonce

* remove extra Nonce

* update lockfile for {"substrate"}

---------

Co-authored-by: parity-processbot <>
This commit is contained in:
Juan
2023-07-14 10:13:39 +02:00
committed by GitHub
parent 2802414473
commit b95cc76d7c
27 changed files with 221 additions and 233 deletions
+183 -183
View File
File diff suppressed because it is too large Load Diff
@@ -593,8 +593,7 @@ mod tests {
type BlockLength = (); type BlockLength = ();
type RuntimeOrigin = RuntimeOrigin; type RuntimeOrigin = RuntimeOrigin;
type RuntimeCall = RuntimeCall; type RuntimeCall = RuntimeCall;
type Index = u64; type Nonce = u64;
type Hash = H256; type Hash = H256;
type Hashing = BlakeTwo256; type Hashing = BlakeTwo256;
type AccountId = u64; type AccountId = u64;
+1 -2
View File
@@ -711,8 +711,7 @@ mod tests {
type DbWeight = (); type DbWeight = ();
type RuntimeOrigin = RuntimeOrigin; type RuntimeOrigin = RuntimeOrigin;
type RuntimeCall = RuntimeCall; type RuntimeCall = RuntimeCall;
type Index = u64; type Nonce = u64;
type Hash = H256; type Hash = H256;
type Hashing = BlakeTwo256; type Hashing = BlakeTwo256;
type AccountId = u64; type AccountId = u64;
+1 -1
View File
@@ -741,7 +741,7 @@ mod tests {
type DbWeight = (); type DbWeight = ();
type RuntimeOrigin = RuntimeOrigin; type RuntimeOrigin = RuntimeOrigin;
type RuntimeCall = RuntimeCall; type RuntimeCall = RuntimeCall;
type Index = u64; type Nonce = u64;
type Hash = H256; type Hash = H256;
type Hashing = BlakeTwo256; type Hashing = BlakeTwo256;
type AccountId = u64; type AccountId = u64;
+1 -2
View File
@@ -904,8 +904,7 @@ mod tests {
type DbWeight = (); type DbWeight = ();
type RuntimeOrigin = RuntimeOrigin; type RuntimeOrigin = RuntimeOrigin;
type RuntimeCall = RuntimeCall; type RuntimeCall = RuntimeCall;
type Index = u64; type Nonce = u64;
type Hash = H256; type Hash = H256;
type Hashing = BlakeTwo256; type Hashing = BlakeTwo256;
type AccountId = u64; type AccountId = u64;
+1 -1
View File
@@ -147,7 +147,7 @@ mod tests {
impl frame_system::Config for Test { impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything; type BaseCallFilter = frame_support::traits::Everything;
type RuntimeOrigin = RuntimeOrigin; type RuntimeOrigin = RuntimeOrigin;
type Index = u64; type Nonce = u64;
type RuntimeCall = RuntimeCall; type RuntimeCall = RuntimeCall;
type Hash = H256; type Hash = H256;
type Hashing = BlakeTwo256; type Hashing = BlakeTwo256;
@@ -116,8 +116,7 @@ impl frame_system::Config for Test {
type DbWeight = (); type DbWeight = ();
type RuntimeOrigin = RuntimeOrigin; type RuntimeOrigin = RuntimeOrigin;
type RuntimeCall = RuntimeCall; type RuntimeCall = RuntimeCall;
type Index = u64; type Nonce = u64;
type Hash = H256; type Hash = H256;
type Hashing = BlakeTwo256; type Hashing = BlakeTwo256;
type AccountId = AccountId; type AccountId = AccountId;
@@ -716,8 +716,7 @@ mod tests {
type BaseCallFilter = frame_support::traits::Everything; type BaseCallFilter = frame_support::traits::Everything;
type RuntimeOrigin = RuntimeOrigin; type RuntimeOrigin = RuntimeOrigin;
type RuntimeCall = RuntimeCall; type RuntimeCall = RuntimeCall;
type Index = u64; type Nonce = u64;
type Hash = H256; type Hash = H256;
type Hashing = BlakeTwo256; type Hashing = BlakeTwo256;
type AccountId = u64; type AccountId = u64;
+1 -1
View File
@@ -514,7 +514,7 @@ mod tests {
type DbWeight = (); type DbWeight = ();
type RuntimeOrigin = RuntimeOrigin; type RuntimeOrigin = RuntimeOrigin;
type RuntimeCall = RuntimeCall; type RuntimeCall = RuntimeCall;
type Index = u64; type Nonce = u64;
type Hash = H256; type Hash = H256;
type Hashing = BlakeTwo256; type Hashing = BlakeTwo256;
type AccountId = AccountId; type AccountId = AccountId;
+1 -2
View File
@@ -532,8 +532,7 @@ mod tests {
type BlockLength = (); type BlockLength = ();
type RuntimeOrigin = RuntimeOrigin; type RuntimeOrigin = RuntimeOrigin;
type RuntimeCall = RuntimeCall; type RuntimeCall = RuntimeCall;
type Index = u64; type Nonce = u64;
type Hash = H256; type Hash = H256;
type Hashing = BlakeTwo256; type Hashing = BlakeTwo256;
type AccountId = u64; type AccountId = u64;
+2 -3
View File
@@ -175,8 +175,7 @@ impl frame_system::Config for Runtime {
type BlockLength = BlockLength; type BlockLength = BlockLength;
type RuntimeOrigin = RuntimeOrigin; type RuntimeOrigin = RuntimeOrigin;
type RuntimeCall = RuntimeCall; type RuntimeCall = RuntimeCall;
type Index = Nonce; type Nonce = Nonce;
type Hash = Hash; type Hash = Hash;
type Hashing = BlakeTwo256; type Hashing = BlakeTwo256;
type AccountId = AccountId; type AccountId = AccountId;
@@ -734,7 +733,7 @@ where
call: RuntimeCall, call: RuntimeCall,
public: <Signature as Verify>::Signer, public: <Signature as Verify>::Signer,
account: AccountId, account: AccountId,
nonce: <Runtime as frame_system::Config>::Index, nonce: <Runtime as frame_system::Config>::Nonce,
) -> Option<(RuntimeCall, <UncheckedExtrinsic as ExtrinsicT>::SignaturePayload)> { ) -> Option<(RuntimeCall, <UncheckedExtrinsic as ExtrinsicT>::SignaturePayload)> {
use sp_runtime::traits::StaticLookup; use sp_runtime::traits::StaticLookup;
// take the biggest period possible. // take the biggest period possible.
+1 -2
View File
@@ -96,8 +96,7 @@ impl frame_system::Config for Test {
type DbWeight = (); type DbWeight = ();
type RuntimeOrigin = RuntimeOrigin; type RuntimeOrigin = RuntimeOrigin;
type RuntimeCall = RuntimeCall; type RuntimeCall = RuntimeCall;
type Index = u64; type Nonce = u64;
type Hash = H256; type Hash = H256;
type Hashing = BlakeTwo256; type Hashing = BlakeTwo256;
type AccountId = u64; type AccountId = u64;
+2 -3
View File
@@ -160,8 +160,7 @@ impl frame_system::Config for Runtime {
type BlockLength = BlockLength; type BlockLength = BlockLength;
type RuntimeOrigin = RuntimeOrigin; type RuntimeOrigin = RuntimeOrigin;
type RuntimeCall = RuntimeCall; type RuntimeCall = RuntimeCall;
type Index = Nonce; type Nonce = Nonce;
type Hash = Hash; type Hash = Hash;
type Hashing = BlakeTwo256; type Hashing = BlakeTwo256;
type AccountId = AccountId; type AccountId = AccountId;
@@ -782,7 +781,7 @@ where
call: RuntimeCall, call: RuntimeCall,
public: <Signature as Verify>::Signer, public: <Signature as Verify>::Signer,
account: AccountId, account: AccountId,
nonce: <Runtime as frame_system::Config>::Index, nonce: <Runtime as frame_system::Config>::Nonce,
) -> Option<(RuntimeCall, <UncheckedExtrinsic as ExtrinsicT>::SignaturePayload)> { ) -> Option<(RuntimeCall, <UncheckedExtrinsic as ExtrinsicT>::SignaturePayload)> {
use sp_runtime::traits::StaticLookup; use sp_runtime::traits::StaticLookup;
// take the biggest period possible. // take the biggest period possible.
+2 -3
View File
@@ -155,8 +155,7 @@ impl frame_system::Config for Runtime {
type DbWeight = RocksDbWeight; type DbWeight = RocksDbWeight;
type RuntimeOrigin = RuntimeOrigin; type RuntimeOrigin = RuntimeOrigin;
type RuntimeCall = RuntimeCall; type RuntimeCall = RuntimeCall;
type Index = Nonce; type Nonce = Nonce;
type Hash = Hash; type Hash = Hash;
type Hashing = BlakeTwo256; type Hashing = BlakeTwo256;
type AccountId = AccountId; type AccountId = AccountId;
@@ -676,7 +675,7 @@ where
call: RuntimeCall, call: RuntimeCall,
public: <Signature as Verify>::Signer, public: <Signature as Verify>::Signer,
account: AccountId, account: AccountId,
nonce: <Runtime as frame_system::Config>::Index, nonce: <Runtime as frame_system::Config>::Nonce,
) -> Option<(RuntimeCall, <UncheckedExtrinsic as ExtrinsicT>::SignaturePayload)> { ) -> Option<(RuntimeCall, <UncheckedExtrinsic as ExtrinsicT>::SignaturePayload)> {
use sp_runtime::traits::StaticLookup; use sp_runtime::traits::StaticLookup;
// take the biggest period possible. // take the biggest period possible.
+2 -3
View File
@@ -140,8 +140,7 @@ impl frame_system::Config for Runtime {
type DbWeight = (); type DbWeight = ();
type RuntimeOrigin = RuntimeOrigin; type RuntimeOrigin = RuntimeOrigin;
type RuntimeCall = RuntimeCall; type RuntimeCall = RuntimeCall;
type Index = Nonce; type Nonce = Nonce;
type Hash = HashT; type Hash = HashT;
type Hashing = BlakeTwo256; type Hashing = BlakeTwo256;
type AccountId = AccountId; type AccountId = AccountId;
@@ -385,7 +384,7 @@ where
call: RuntimeCall, call: RuntimeCall,
public: <Signature as Verify>::Signer, public: <Signature as Verify>::Signer,
account: AccountId, account: AccountId,
nonce: <Runtime as frame_system::Config>::Index, nonce: <Runtime as frame_system::Config>::Nonce,
) -> Option<(RuntimeCall, <UncheckedExtrinsic as ExtrinsicT>::SignaturePayload)> { ) -> Option<(RuntimeCall, <UncheckedExtrinsic as ExtrinsicT>::SignaturePayload)> {
let period = let period =
BlockHashCount::get().checked_next_power_of_two().map(|c| c / 2).unwrap_or(2) as u64; BlockHashCount::get().checked_next_power_of_two().map(|c| c / 2).unwrap_or(2) as u64;
+2 -3
View File
@@ -150,8 +150,7 @@ impl frame_system::Config for Runtime {
type BlockLength = BlockLength; type BlockLength = BlockLength;
type RuntimeOrigin = RuntimeOrigin; type RuntimeOrigin = RuntimeOrigin;
type RuntimeCall = RuntimeCall; type RuntimeCall = RuntimeCall;
type Index = Nonce; type Nonce = Nonce;
type Hash = Hash; type Hash = Hash;
type Hashing = BlakeTwo256; type Hashing = BlakeTwo256;
type AccountId = AccountId; type AccountId = AccountId;
@@ -610,7 +609,7 @@ where
call: RuntimeCall, call: RuntimeCall,
public: <Signature as Verify>::Signer, public: <Signature as Verify>::Signer,
account: AccountId, account: AccountId,
nonce: <Runtime as frame_system::Config>::Index, nonce: <Runtime as frame_system::Config>::Nonce,
) -> Option<(RuntimeCall, <UncheckedExtrinsic as ExtrinsicT>::SignaturePayload)> { ) -> Option<(RuntimeCall, <UncheckedExtrinsic as ExtrinsicT>::SignaturePayload)> {
use sp_runtime::traits::StaticLookup; use sp_runtime::traits::StaticLookup;
// take the biggest period possible. // take the biggest period possible.
+4 -4
View File
@@ -83,7 +83,7 @@ macro_rules! construct_runtime_prelude {
pub(crate) fn [<create_uxt_ $runtime>]( pub(crate) fn [<create_uxt_ $runtime>](
raw_solution: EPM::RawSolution<EPM::SolutionOf<Runtime>>, raw_solution: EPM::RawSolution<EPM::SolutionOf<Runtime>>,
signer: crate::signer::Signer, signer: crate::signer::Signer,
nonce: crate::prelude::Index, nonce: crate::prelude::Nonce,
tip: crate::prelude::Balance, tip: crate::prelude::Balance,
era: sp_runtime::generic::Era, era: sp_runtime::generic::Era,
) -> UncheckedExtrinsic { ) -> UncheckedExtrinsic {
@@ -121,7 +121,7 @@ macro_rules! construct_runtime_prelude {
// NOTE: we might be able to use some code from the bridges repo here. // NOTE: we might be able to use some code from the bridges repo here.
fn signed_ext_builder_polkadot( fn signed_ext_builder_polkadot(
nonce: Index, nonce: Nonce,
tip: Balance, tip: Balance,
era: sp_runtime::generic::Era, era: sp_runtime::generic::Era,
) -> polkadot_runtime_exports::SignedExtra { ) -> polkadot_runtime_exports::SignedExtra {
@@ -140,7 +140,7 @@ fn signed_ext_builder_polkadot(
} }
fn signed_ext_builder_kusama( fn signed_ext_builder_kusama(
nonce: Index, nonce: Nonce,
tip: Balance, tip: Balance,
era: sp_runtime::generic::Era, era: sp_runtime::generic::Era,
) -> kusama_runtime_exports::SignedExtra { ) -> kusama_runtime_exports::SignedExtra {
@@ -158,7 +158,7 @@ fn signed_ext_builder_kusama(
} }
fn signed_ext_builder_westend( fn signed_ext_builder_westend(
nonce: Index, nonce: Nonce,
tip: Balance, tip: Balance,
era: sp_runtime::generic::Era, era: sp_runtime::generic::Era,
) -> westend_runtime_exports::SignedExtra { ) -> westend_runtime_exports::SignedExtra {
+2 -2
View File
@@ -26,8 +26,8 @@ pub type AccountId = core_primitives::AccountId;
pub type BlockNumber = core_primitives::BlockNumber; pub type BlockNumber = core_primitives::BlockNumber;
/// The balance type. /// The balance type.
pub type Balance = core_primitives::Balance; pub type Balance = core_primitives::Balance;
/// The index of an account. /// Index of a transaction in the chain.
pub type Index = core_primitives::AccountIndex; pub type Nonce = core_primitives::Nonce;
/// The hash type. We re-export it here, but we can easily get it from block as well. /// The hash type. We re-export it here, but we can easily get it from block as well.
pub type Hash = core_primitives::Hash; pub type Hash = core_primitives::Hash;
/// The header type. We re-export it here, but we can easily get it from block as well. /// The header type. We re-export it here, but we can easily get it from block as well.
+4 -4
View File
@@ -16,7 +16,7 @@
//! Wrappers around creating a signer account. //! Wrappers around creating a signer account.
use crate::{prelude::*, rpc::SharedRpcClient, AccountId, Error, Index, Pair, LOG_TARGET}; use crate::{prelude::*, rpc::SharedRpcClient, AccountId, Error, Nonce, Pair, LOG_TARGET};
use frame_system::AccountInfo; use frame_system::AccountInfo;
use sp_core::{crypto::Pair as _, storage::StorageKey}; use sp_core::{crypto::Pair as _, storage::StorageKey};
@@ -39,8 +39,8 @@ pub(crate) async fn get_account_info<T: frame_system::Config<Hash = Hash> + EPM:
rpc: &SharedRpcClient, rpc: &SharedRpcClient,
who: &T::AccountId, who: &T::AccountId,
maybe_at: Option<T::Hash>, maybe_at: Option<T::Hash>,
) -> Result<Option<AccountInfo<Index, T::AccountData>>, Error<T>> { ) -> Result<Option<AccountInfo<Nonce, T::AccountData>>, Error<T>> {
rpc.get_storage_and_decode::<AccountInfo<Index, T::AccountData>>( rpc.get_storage_and_decode::<AccountInfo<Nonce, T::AccountData>>(
&StorageKey(<frame_system::Account<T>>::hashed_key_for(&who)), &StorageKey(<frame_system::Account<T>>::hashed_key_for(&who)),
maybe_at, maybe_at,
) )
@@ -52,7 +52,7 @@ pub(crate) async fn get_account_info<T: frame_system::Config<Hash = Hash> + EPM:
pub(crate) async fn signer_uri_from_string< pub(crate) async fn signer_uri_from_string<
T: frame_system::Config< T: frame_system::Config<
AccountId = AccountId, AccountId = AccountId,
Index = Index, Nonce = Nonce,
AccountData = pallet_balances::AccountData<Balance>, AccountData = pallet_balances::AccountData<Balance>,
Hash = Hash, Hash = Hash,
> + EPM::Config, > + EPM::Config,
@@ -51,7 +51,7 @@ impl frame_system::Config for Test {
type BlockLength = (); type BlockLength = ();
type DbWeight = (); type DbWeight = ();
type RuntimeOrigin = RuntimeOrigin; type RuntimeOrigin = RuntimeOrigin;
type Index = u64; type Nonce = u64;
type Hash = H256; type Hash = H256;
type RuntimeCall = RuntimeCall; type RuntimeCall = RuntimeCall;
type Hashing = BlakeTwo256; type Hashing = BlakeTwo256;
@@ -56,7 +56,7 @@ impl frame_system::Config for Test {
type BlockLength = (); type BlockLength = ();
type DbWeight = (); type DbWeight = ();
type RuntimeOrigin = RuntimeOrigin; type RuntimeOrigin = RuntimeOrigin;
type Index = u64; type Nonce = u64;
type Hash = H256; type Hash = H256;
type RuntimeCall = RuntimeCall; type RuntimeCall = RuntimeCall;
type Hashing = BlakeTwo256; type Hashing = BlakeTwo256;
+1 -1
View File
@@ -200,7 +200,7 @@ parameter_types! {
impl frame_system::Config for Test { impl frame_system::Config for Test {
type RuntimeOrigin = RuntimeOrigin; type RuntimeOrigin = RuntimeOrigin;
type RuntimeCall = RuntimeCall; type RuntimeCall = RuntimeCall;
type Index = u64; type Nonce = u64;
type Hash = H256; type Hash = H256;
type Hashing = ::sp_runtime::traits::BlakeTwo256; type Hashing = ::sp_runtime::traits::BlakeTwo256;
type AccountId = AccountId; type AccountId = AccountId;
+1 -1
View File
@@ -77,7 +77,7 @@ parameter_types! {
impl frame_system::Config for Runtime { impl frame_system::Config for Runtime {
type RuntimeOrigin = RuntimeOrigin; type RuntimeOrigin = RuntimeOrigin;
type RuntimeCall = RuntimeCall; type RuntimeCall = RuntimeCall;
type Index = u64; type Nonce = u64;
type Hash = H256; type Hash = H256;
type Hashing = ::sp_runtime::traits::BlakeTwo256; type Hashing = ::sp_runtime::traits::BlakeTwo256;
type AccountId = AccountId; type AccountId = AccountId;
@@ -66,7 +66,7 @@ parameter_types! {
impl frame_system::Config for Runtime { impl frame_system::Config for Runtime {
type RuntimeOrigin = RuntimeOrigin; type RuntimeOrigin = RuntimeOrigin;
type RuntimeCall = RuntimeCall; type RuntimeCall = RuntimeCall;
type Index = u64; type Nonce = u64;
type Hash = H256; type Hash = H256;
type Hashing = ::sp_runtime::traits::BlakeTwo256; type Hashing = ::sp_runtime::traits::BlakeTwo256;
type AccountId = AccountId; type AccountId = AccountId;
@@ -52,7 +52,7 @@ parameter_types! {
impl frame_system::Config for Runtime { impl frame_system::Config for Runtime {
type RuntimeOrigin = RuntimeOrigin; type RuntimeOrigin = RuntimeOrigin;
type RuntimeCall = RuntimeCall; type RuntimeCall = RuntimeCall;
type Index = u64; type Nonce = u64;
type Hash = H256; type Hash = H256;
type Hashing = ::sp_runtime::traits::BlakeTwo256; type Hashing = ::sp_runtime::traits::BlakeTwo256;
type AccountId = AccountId; type AccountId = AccountId;
@@ -55,7 +55,7 @@ parameter_types! {
impl frame_system::Config for Runtime { impl frame_system::Config for Runtime {
type RuntimeOrigin = RuntimeOrigin; type RuntimeOrigin = RuntimeOrigin;
type RuntimeCall = RuntimeCall; type RuntimeCall = RuntimeCall;
type Index = u64; type Nonce = u64;
type Hash = H256; type Hash = H256;
type Hashing = ::sp_runtime::traits::BlakeTwo256; type Hashing = ::sp_runtime::traits::BlakeTwo256;
type AccountId = AccountId; type AccountId = AccountId;
@@ -51,7 +51,7 @@ parameter_types! {
impl frame_system::Config for Runtime { impl frame_system::Config for Runtime {
type RuntimeOrigin = RuntimeOrigin; type RuntimeOrigin = RuntimeOrigin;
type RuntimeCall = RuntimeCall; type RuntimeCall = RuntimeCall;
type Index = u64; type Nonce = u64;
type Hash = H256; type Hash = H256;
type Hashing = ::sp_runtime::traits::BlakeTwo256; type Hashing = ::sp_runtime::traits::BlakeTwo256;
type AccountId = AccountId; type AccountId = AccountId;