Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
Uses u32 in mock block
Browse files Browse the repository at this point in the history
  • Loading branch information
gupnik committed Jun 20, 2023
1 parent 6f706bd commit 60bd4c6
Show file tree
Hide file tree
Showing 20 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion client/chain-spec/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ pub struct Extension {
pub pool: PoolParams,
}

pub type BlockNumber = u64;
pub type BlockNumber = u32;

/// A chain spec supporting forkable `ClientParams`.
pub type MyChainSpec1<G> = GenericChainSpec<G, Forks<BlockNumber, ClientParams>>;
Expand Down
2 changes: 1 addition & 1 deletion client/chain-spec/src/extension.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ pub trait IsForks {
}

impl IsForks for Option<()> {
type BlockNumber = u64;
type BlockNumber = u32;
type Extension = Self;
}

Expand Down
2 changes: 1 addition & 1 deletion client/chain-spec/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
//! pub pool: PoolParams,
//! }
//!
//! pub type BlockNumber = u64;
//! pub type BlockNumber = u32;
//!
//! /// A chain spec supporting forkable `ClientParams`.
//! pub type MyChainSpec1<G> = GenericChainSpec<G, Forks<BlockNumber, ClientParams>>;
Expand Down
2 changes: 1 addition & 1 deletion client/statement-store/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -891,7 +891,7 @@ mod tests {
type Extrinsic = sp_runtime::OpaqueExtrinsic;
type Hash = sp_core::H256;
type Hashing = sp_runtime::traits::BlakeTwo256;
type BlockNumber = u64;
type BlockNumber = u32;
type Header = sp_runtime::generic::Header<BlockNumber, Hashing>;
type Block = sp_runtime::generic::Block<Header, Extrinsic>;

Expand Down
2 changes: 1 addition & 1 deletion frame/alliance/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ pub use crate as pallet_alliance;

use super::*;

type BlockNumber = u64;
type BlockNumber = u32;
type AccountId = u64;

parameter_types! {
Expand Down
2 changes: 1 addition & 1 deletion frame/authority-discovery/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ mod tests {
type FullIdentificationOf = ();
}

pub type BlockNumber = u64;
pub type BlockNumber = u32;

parameter_types! {
pub const Period: BlockNumber = 1;
Expand Down
6 changes: 3 additions & 3 deletions frame/election-provider-multi-phase/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ frame_support::construct_runtime!(

pub(crate) type Balance = u64;
pub(crate) type AccountId = u64;
pub(crate) type BlockNumber = u64;
pub(crate) type BlockNumber = u32;
pub(crate) type VoterIndex = u32;
pub(crate) type TargetIndex = u16;

Expand Down Expand Up @@ -319,7 +319,7 @@ impl onchain::Config for OnChainSeqPhragmen {
pub struct MockFallback;
impl ElectionProviderBase for MockFallback {
type AccountId = AccountId;
type BlockNumber = u64;
type BlockNumber = u32;
type Error = &'static str;
type DataProvider = StakingMock;
type MaxWinners = MaxWinners;
Expand Down Expand Up @@ -433,7 +433,7 @@ pub struct ExtBuilder {}
pub struct StakingMock;
impl ElectionDataProvider for StakingMock {
type AccountId = AccountId;
type BlockNumber = u64;
type BlockNumber = u32;
type MaxVotesPerVoter = MaxNominations;

fn electable_targets(maybe_max_len: Option<usize>) -> data_provider::Result<Vec<AccountId>> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ frame_support::construct_runtime!(

pub(crate) type AccountId = u128;
pub(crate) type AccountIndex = u32;
pub(crate) type BlockNumber = u64;
pub(crate) type BlockNumber = u32;
pub(crate) type Balance = u64;
pub(crate) type VoterIndex = u32;
pub(crate) type TargetIndex = u16;
Expand Down
2 changes: 1 addition & 1 deletion frame/election-provider-support/src/onchain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ mod tests {
use sp_npos_elections::Support;
use sp_runtime::Perbill;
type AccountId = u64;
type BlockNumber = u64;
type BlockNumber = u32;

pub type Header = sp_runtime::generic::Header<BlockNumber, sp_runtime::traits::BlakeTwo256>;
pub type UncheckedExtrinsic = sp_runtime::generic::UncheckedExtrinsic<AccountId, (), (), ()>;
Expand Down
2 changes: 1 addition & 1 deletion frame/fast-unstake/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ use sp_std::prelude::*;

pub type AccountId = u128;
pub type AccountIndex = u32;
pub type BlockNumber = u64;
pub type BlockNumber = u32;
pub type Balance = u128;
pub type T = Runtime;

Expand Down
2 changes: 1 addition & 1 deletion frame/nomination-pools/benchmarking/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use sp_runtime::{

type AccountId = u128;
type AccountIndex = u32;
type BlockNumber = u64;
type BlockNumber = u32;
type Balance = u128;

impl frame_system::Config for Runtime {
Expand Down
2 changes: 1 addition & 1 deletion frame/nomination-pools/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use frame_system::RawOrigin;
use sp_runtime::FixedU128;
use sp_staking::Stake;

pub type BlockNumber = u64;
pub type BlockNumber = u32;
pub type AccountId = u128;
pub type Balance = u128;
pub type RewardCounter = FixedU128;
Expand Down
2 changes: 1 addition & 1 deletion frame/nomination-pools/test-staking/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ use sp_runtime::{

type AccountId = u128;
type AccountIndex = u32;
type BlockNumber = u64;
type BlockNumber = u32;
type Balance = u128;

pub(crate) type T = Runtime;
Expand Down
2 changes: 1 addition & 1 deletion frame/root-offences/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ use sp_std::collections::btree_map::BTreeMap;
type Block = frame_system::mocking::MockBlock<Test>;
type AccountId = u64;
type Balance = u64;
type BlockNumber = u64;
type BlockNumber = u32;

pub const INIT_TIMESTAMP: u64 = 30_000;
pub const BLOCK_TIME: u64 = 1000;
Expand Down
2 changes: 1 addition & 1 deletion frame/staking/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,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 BlockNumber = u64;
pub(crate) type BlockNumber = u32;
pub(crate) type Balance = u128;

/// Another session handler struct to test on_disabled.
Expand Down
2 changes: 1 addition & 1 deletion frame/support/test/compile_pass/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {

pub type Signature = sr25519::Signature;
pub type AccountId = <Signature as Verify>::Signer;
pub type BlockNumber = u64;
pub type BlockNumber = u32;
pub type Index = u64;

parameter_types! {
Expand Down
2 changes: 1 addition & 1 deletion frame/utility/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ use sp_runtime::{
TokenError,
};

type BlockNumber = u64;
type BlockNumber = u32;

// example module to test behaviors.
#[frame_support::pallet(dev_mode)]
Expand Down
2 changes: 1 addition & 1 deletion primitives/test-primitives/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ pub type AccountId = <AccountSignature as Verify>::Signer;
/// A simple hash type for all our hashing.
pub type Hash = H256;
/// The block number type used in this runtime.
pub type BlockNumber = u64;
pub type BlockNumber = u32;
/// Index of a transaction.
pub type Index = u64;
/// The item of a block digest.
Expand Down
2 changes: 1 addition & 1 deletion test-utils/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ pub type Hash = H256;
/// The hashing algorithm used.
pub type Hashing = BlakeTwo256;
/// The block number type used in this runtime.
pub type BlockNumber = u64;
pub type BlockNumber = u32;
/// Index of a transaction.
pub type Index = u64;
/// The item of a block digest.
Expand Down
2 changes: 1 addition & 1 deletion utils/frame/rpc/client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ mod tests {
use tokio::sync::Mutex;

type Block = TBlock<ExtrinsicWrapper<()>>;
type BlockNumber = u64;
type BlockNumber = u32;
type Hash = H256;

struct MockHeaderProvider(pub Arc<Mutex<VecDeque<BlockNumber>>>);
Expand Down

0 comments on commit 60bd4c6

Please sign in to comment.