Skip to content

Commit

Permalink
Tiny cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
nazar-pc committed Apr 5, 2024
1 parent b0082e5 commit 71db792
Show file tree
Hide file tree
Showing 11 changed files with 22 additions and 11 deletions.
3 changes: 2 additions & 1 deletion crates/pallet-domains/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ use frame_support::weights::{IdentityFee, Weight};
use frame_support::{assert_err, assert_ok, derive_impl, parameter_types, PalletId};
use frame_system::mocking::MockUncheckedExtrinsic;
use frame_system::pallet_prelude::*;
use frame_system::DefaultConfig;
use scale_info::TypeInfo;
use sp_core::crypto::Pair;
use sp_core::storage::{StateVersion, StorageKey};
Expand Down Expand Up @@ -76,7 +77,7 @@ type BlockNumber = u64;
type Hash = H256;
type AccountId = u128;

#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
#[derive_impl(frame_system::config_preludes::TestDefaultConfig)]
impl frame_system::Config for Test {
type Block = Block;
type Hash = Hash;
Expand Down
3 changes: 2 additions & 1 deletion crates/pallet-feeds/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use crate::feed_processor::{FeedObjectMapping, FeedProcessor, FeedProcessor as F
use crate::{self as pallet_feeds};
use codec::{Compact, CompactLen, Decode, Encode};
use frame_support::{derive_impl, parameter_types};
use frame_system::DefaultConfig;
use scale_info::TypeInfo;
use sp_runtime::BuildStorage;

Expand All @@ -15,7 +16,7 @@ frame_support::construct_runtime!(
}
);

#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
#[derive_impl(frame_system::config_preludes::TestDefaultConfig)]
impl frame_system::Config for Test {
type Block = Block;
}
Expand Down
3 changes: 2 additions & 1 deletion crates/pallet-grandpa-finality-verifier/src/tests/mock.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use frame_support::weights::Weight;
use frame_support::{construct_runtime, derive_impl, parameter_types};
use frame_system::DefaultConfig;
use sp_runtime::Perbill;

pub(crate) type ChainId = u64;
Expand All @@ -21,7 +22,7 @@ parameter_types! {
pub const AvailableBlockRatio: Perbill = Perbill::one();
}

#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
#[derive_impl(frame_system::config_preludes::TestDefaultConfig)]
impl frame_system::Config for TestRuntime {
type Block = Block;
}
Expand Down
3 changes: 2 additions & 1 deletion crates/pallet-object-store/src/mock.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use frame_support::derive_impl;
use frame_system::DefaultConfig;
use sp_runtime::BuildStorage;

type Block = frame_system::mocking::MockBlock<Test>;
Expand All @@ -10,7 +11,7 @@ frame_support::construct_runtime!(
}
);

#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
#[derive_impl(frame_system::config_preludes::TestDefaultConfig)]
impl frame_system::Config for Test {
type Block = Block;
}
Expand Down
3 changes: 2 additions & 1 deletion crates/pallet-offences-subspace/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ use codec::Encode;
use frame_support::derive_impl;
use frame_support::weights::constants::ParityDbWeight;
use frame_support::weights::Weight;
use frame_system::DefaultConfig;
use sp_consensus_subspace::offence::{self, Kind, OffenceDetails};
use sp_consensus_subspace::FarmerPublicKey;
use sp_core::H256;
Expand Down Expand Up @@ -58,7 +59,7 @@ frame_support::construct_runtime!(
}
);

#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
#[derive_impl(frame_system::config_preludes::TestDefaultConfig)]
impl frame_system::Config for Runtime {
type Block = Block;
type DbWeight = ParityDbWeight;
Expand Down
3 changes: 2 additions & 1 deletion crates/pallet-rewards/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

use frame_support::derive_impl;
use frame_support::traits::{ConstU128, ConstU32};
use frame_system::DefaultConfig;
use sp_runtime::traits::parameter_types;
use subspace_runtime_primitives::{
FindBlockRewardAddress, FindVotingRewardAddresses, RewardsEnabled,
Expand All @@ -18,7 +19,7 @@ frame_support::construct_runtime!(
}
);

#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
#[derive_impl(frame_system::config_preludes::TestDefaultConfig)]
impl frame_system::Config for Test {
type Block = Block;
type AccountData = pallet_balances::AccountData<Balance>;
Expand Down
3 changes: 2 additions & 1 deletion crates/pallet-subspace/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ use crate::{
};
use frame_support::traits::{ConstU128, ConstU16, OnInitialize};
use frame_support::{derive_impl, parameter_types};
use frame_system::DefaultConfig;
use futures::executor::block_on;
use rand::Rng;
use schnorrkel::Keypair;
Expand Down Expand Up @@ -93,7 +94,7 @@ frame_support::construct_runtime!(
}
);

#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
#[derive_impl(frame_system::config_preludes::TestDefaultConfig)]
impl frame_system::Config for Test {
type Block = Block;
type AccountData = pallet_balances::AccountData<Balance>;
Expand Down
3 changes: 2 additions & 1 deletion domains/pallets/domain-id/src/tests.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use crate::{self as pallet_domain_id};
use frame_support::derive_impl;
use frame_system::DefaultConfig;
use sp_runtime::BuildStorage;

type Block = frame_system::mocking::MockBlock<Test>;
Expand All @@ -13,7 +14,7 @@ frame_support::construct_runtime!(

impl pallet_domain_id::Config for Test {}

#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
#[derive_impl(frame_system::config_preludes::TestDefaultConfig)]
impl frame_system::Config for Test {
type Block = Block;
}
Expand Down
3 changes: 2 additions & 1 deletion domains/pallets/executive/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use frame_support::dispatch::DispatchInfo;
use frame_support::weights::IdentityFee;
use frame_support::{derive_impl, parameter_types};
use frame_system::mocking::MockUncheckedExtrinsic;
use frame_system::DefaultConfig;
use pallet_balances::AccountData;
use sp_runtime::BuildStorage;

Expand All @@ -19,7 +20,7 @@ frame_support::construct_runtime!(
}
);

#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
#[derive_impl(frame_system::config_preludes::TestDefaultConfig)]
impl frame_system::Config for MockRuntime {
type Block = Block;
type AccountData = AccountData<Balance>;
Expand Down
3 changes: 2 additions & 1 deletion domains/pallets/messenger/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ macro_rules! impl_runtime {
use sp_messenger::endpoint::{Endpoint, EndpointHandler, EndpointId};
use sp_messenger::messages::ChainId;
use sp_runtime::traits::Convert;
use frame_system::DefaultConfig;
use sp_runtime::BuildStorage;
use crate::HoldIdentifier;
use sp_domains::ChannelId;
Expand All @@ -50,7 +51,7 @@ macro_rules! impl_runtime {
}
);

#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
#[derive_impl(frame_system::config_preludes::TestDefaultConfig )]
impl frame_system::Config for $runtime {
type Block = Block;
type AccountData = AccountData<Balance>;
Expand Down
3 changes: 2 additions & 1 deletion domains/pallets/transporter/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use crate::{Config, TryConvertBack};
use codec::{Decode, Encode};
use domain_runtime_primitives::MultiAccountId;
use frame_support::{derive_impl, parameter_types};
use frame_system::DefaultConfig;
use pallet_balances::AccountData;
use sp_messenger::endpoint::{EndpointId, EndpointRequest, Sender};
use sp_messenger::messages::ChainId;
Expand All @@ -21,7 +22,7 @@ frame_support::construct_runtime!(
}
);

#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
#[derive_impl(frame_system::config_preludes::TestDefaultConfig)]
impl frame_system::Config for MockRuntime {
type Block = Block;
type AccountId = AccountId;
Expand Down

0 comments on commit 71db792

Please sign in to comment.