Skip to content

Commit

Permalink
Remove unused types (paritytech#13091)
Browse files Browse the repository at this point in the history
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
  • Loading branch information
ggwpez authored and ltfschoen committed Feb 22, 2023
1 parent 0890d78 commit a21a7f8
Show file tree
Hide file tree
Showing 37 changed files with 9 additions and 183 deletions.
9 changes: 1 addition & 8 deletions frame/atomic-swap/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
use super::*;
use crate as pallet_atomic_swap;

use frame_support::{
parameter_types,
traits::{ConstU32, ConstU64},
};
use frame_support::traits::{ConstU32, ConstU64};
use sp_core::H256;
use sp_runtime::{
testing::Header,
Expand All @@ -28,10 +25,6 @@ frame_support::construct_runtime!(
}
);

parameter_types! {
pub BlockWeights: frame_system::limits::BlockWeights =
frame_system::limits::BlockWeights::simple_max(frame_support::weights::Weight::from_ref_time(1024));
}
impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
Expand Down
5 changes: 0 additions & 5 deletions frame/aura/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,6 @@ frame_support::construct_runtime!(
}
);

parameter_types! {
pub BlockWeights: frame_system::limits::BlockWeights =
frame_system::limits::BlockWeights::simple_max(frame_support::weights::Weight::from_ref_time(1024));
}

impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
Expand Down
2 changes: 0 additions & 2 deletions frame/authority-discovery/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,6 @@ mod tests {
parameter_types! {
pub const Period: BlockNumber = 1;
pub const Offset: BlockNumber = 0;
pub BlockWeights: frame_system::limits::BlockWeights =
frame_system::limits::BlockWeights::simple_max(frame_support::weights::Weight::from_ref_time(1024));
}

impl frame_system::Config for Test {
Expand Down
6 changes: 0 additions & 6 deletions frame/authorship/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,6 @@ mod tests {
use super::*;
use crate as pallet_authorship;
use frame_support::{
parameter_types,
traits::{ConstU32, ConstU64, OnFinalize, OnInitialize},
ConsensusEngineId,
};
Expand All @@ -459,11 +458,6 @@ mod tests {
}
);

parameter_types! {
pub BlockWeights: frame_system::limits::BlockWeights =
frame_system::limits::BlockWeights::simple_max(frame_support::weights::Weight::from_ref_time(1024));
}

impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
Expand Down
5 changes: 0 additions & 5 deletions frame/babe/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,6 @@ frame_support::construct_runtime!(
}
);

parameter_types! {
pub BlockWeights: frame_system::limits::BlockWeights =
frame_system::limits::BlockWeights::simple_max(frame_support::weights::Weight::from_ref_time(1024));
}

impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
Expand Down
2 changes: 0 additions & 2 deletions frame/collective/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,6 @@ pub type MaxMembers = ConstU32<100>;
parameter_types! {
pub const MotionDuration: u64 = 3;
pub const MaxProposals: u32 = 257;
pub BlockWeights: frame_system::limits::BlockWeights =
frame_system::limits::BlockWeights::simple_max(frame_support::weights::Weight::from_ref_time(1024));
}
impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything;
Expand Down
5 changes: 0 additions & 5 deletions frame/conviction-voting/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ use std::collections::BTreeMap;
use frame_support::{
assert_noop, assert_ok, parameter_types,
traits::{ConstU32, ConstU64, Contains, Polling, VoteTally},
weights::Weight,
};
use sp_core::H256;
use sp_runtime::{
Expand Down Expand Up @@ -56,10 +55,6 @@ impl Contains<RuntimeCall> for BaseFilter {
}
}

parameter_types! {
pub BlockWeights: frame_system::limits::BlockWeights =
frame_system::limits::BlockWeights::simple_max(Weight::from_ref_time(1_000_000));
}
impl frame_system::Config for Test {
type BaseCallFilter = BaseFilter;
type BlockWeights = ();
Expand Down
5 changes: 0 additions & 5 deletions frame/examples/basic/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ use crate::*;
use frame_support::{
assert_ok,
dispatch::{DispatchInfo, GetDispatchInfo},
parameter_types,
traits::{ConstU64, OnInitialize},
};
use sp_core::H256;
Expand Down Expand Up @@ -51,10 +50,6 @@ frame_support::construct_runtime!(
}
);

parameter_types! {
pub BlockWeights: frame_system::limits::BlockWeights =
frame_system::limits::BlockWeights::simple_max(frame_support::weights::Weight::from_ref_time(1024));
}
impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
Expand Down
4 changes: 0 additions & 4 deletions frame/examples/offchain-worker/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,6 @@ frame_support::construct_runtime!(
}
);

parameter_types! {
pub BlockWeights: frame_system::limits::BlockWeights =
frame_system::limits::BlockWeights::simple_max(frame_support::weights::Weight::from_ref_time(1024));
}
impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
Expand Down
5 changes: 0 additions & 5 deletions frame/grandpa/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,6 @@ impl_opaque_keys! {
}
}

parameter_types! {
pub BlockWeights: frame_system::limits::BlockWeights =
frame_system::limits::BlockWeights::simple_max(frame_support::weights::Weight::from_ref_time(1024));
}

impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
Expand Down
4 changes: 0 additions & 4 deletions frame/identity/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,6 @@ frame_support::construct_runtime!(
}
);

parameter_types! {
pub BlockWeights: frame_system::limits::BlockWeights =
frame_system::limits::BlockWeights::simple_max(frame_support::weights::Weight::from_ref_time(1024));
}
impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
Expand Down
5 changes: 0 additions & 5 deletions frame/im-online/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,6 @@ pub fn new_test_ext() -> sp_io::TestExternalities {
result
}

parameter_types! {
pub BlockWeights: frame_system::limits::BlockWeights =
frame_system::limits::BlockWeights::simple_max(frame_support::weights::Weight::from_ref_time(1024));
}

impl frame_system::Config for Runtime {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
Expand Down
10 changes: 1 addition & 9 deletions frame/indices/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@
#![cfg(test)]

use crate::{self as pallet_indices, Config};
use frame_support::{
parameter_types,
traits::{ConstU32, ConstU64},
};
use frame_support::traits::{ConstU32, ConstU64};
use sp_core::H256;
use sp_runtime::testing::Header;

Expand All @@ -42,11 +39,6 @@ frame_support::construct_runtime!(
}
);

parameter_types! {
pub BlockWeights: frame_system::limits::BlockWeights =
frame_system::limits::BlockWeights::simple_max(frame_support::weights::Weight::from_ref_time(1024));
}

impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
Expand Down
2 changes: 0 additions & 2 deletions frame/membership/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -539,8 +539,6 @@ mod tests {
);

parameter_types! {
pub BlockWeights: frame_system::limits::BlockWeights =
frame_system::limits::BlockWeights::simple_max(frame_support::weights::Weight::from_ref_time(1024));
pub static Members: Vec<u64> = vec![];
pub static Prime: Option<u64> = None;
}
Expand Down
4 changes: 0 additions & 4 deletions frame/message-queue/src/integration_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,6 @@ frame_support::construct_runtime!(
}
);

parameter_types! {
pub BlockWeights: frame_system::limits::BlockWeights =
frame_system::limits::BlockWeights::simple_max(frame_support::weights::Weight::from_ref_time(1024));
}
impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
Expand Down
4 changes: 0 additions & 4 deletions frame/message-queue/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@ frame_support::construct_runtime!(
MessageQueue: pallet_message_queue::{Pallet, Call, Storage, Event<T>},
}
);
parameter_types! {
pub BlockWeights: frame_system::limits::BlockWeights =
frame_system::limits::BlockWeights::simple_max(frame_support::weights::Weight::from_ref_time(1024));
}
impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
Expand Down
6 changes: 1 addition & 5 deletions frame/multisig/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use super::*;

use crate as pallet_multisig;
use frame_support::{
assert_noop, assert_ok, parameter_types,
assert_noop, assert_ok,
traits::{ConstU32, ConstU64, Contains},
};
use sp_core::H256;
Expand All @@ -47,10 +47,6 @@ frame_support::construct_runtime!(
}
);

parameter_types! {
pub BlockWeights: frame_system::limits::BlockWeights =
frame_system::limits::BlockWeights::simple_max(frame_support::weights::Weight::from_ref_time(1024));
}
impl frame_system::Config for Test {
type BaseCallFilter = TestBaseCallFilter;
type BlockWeights = ();
Expand Down
6 changes: 1 addition & 5 deletions frame/nicks/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ mod tests {
use crate as pallet_nicks;

use frame_support::{
assert_noop, assert_ok, ord_parameter_types, parameter_types,
assert_noop, assert_ok, ord_parameter_types,
traits::{ConstU32, ConstU64},
};
use frame_system::EnsureSignedBy;
Expand All @@ -275,10 +275,6 @@ mod tests {
}
);

parameter_types! {
pub BlockWeights: frame_system::limits::BlockWeights =
frame_system::limits::BlockWeights::simple_max(frame_support::weights::Weight::from_ref_time(1024));
}
impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
Expand Down
8 changes: 0 additions & 8 deletions frame/offences/benchmarking/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ use frame_election_provider_support::{onchain, SequentialPhragmen};
use frame_support::{
parameter_types,
traits::{ConstU32, ConstU64},
weights::{constants::WEIGHT_REF_TIME_PER_SECOND, Weight},
};
use frame_system as system;
use pallet_session::historical as pallet_session_historical;
Expand All @@ -38,13 +37,6 @@ type AccountIndex = u32;
type BlockNumber = u64;
type Balance = u64;

parameter_types! {
pub BlockWeights: frame_system::limits::BlockWeights =
frame_system::limits::BlockWeights::simple_max(
Weight::from_parts(2u64 * WEIGHT_REF_TIME_PER_SECOND, u64::MAX)
);
}

impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
Expand Down
11 changes: 1 addition & 10 deletions frame/offences/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,7 @@ use codec::Encode;
use frame_support::{
parameter_types,
traits::{ConstU32, ConstU64},
weights::{
constants::{RocksDbWeight, WEIGHT_REF_TIME_PER_SECOND},
Weight,
},
weights::{constants::RocksDbWeight, Weight},
};
use sp_core::H256;
use sp_runtime::{
Expand Down Expand Up @@ -83,12 +80,6 @@ frame_support::construct_runtime!(
}
);

parameter_types! {
pub BlockWeights: frame_system::limits::BlockWeights =
frame_system::limits::BlockWeights::simple_max(
Weight::from_parts(2u64 * WEIGHT_REF_TIME_PER_SECOND, u64::MAX),
);
}
impl frame_system::Config for Runtime {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
Expand Down
14 changes: 2 additions & 12 deletions frame/preimage/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//! # Scheduler test environment.
//! # Preimage test environment.
use super::*;

use crate as pallet_preimage;
use frame_support::{
ord_parameter_types, parameter_types,
ord_parameter_types,
traits::{ConstU32, ConstU64, Everything},
weights::constants::RocksDbWeight,
};
Expand All @@ -30,7 +30,6 @@ use sp_core::H256;
use sp_runtime::{
testing::Header,
traits::{BlakeTwo256, IdentityLookup},
Perbill,
};

type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic<Test>;
Expand All @@ -48,10 +47,6 @@ frame_support::construct_runtime!(
}
);

parameter_types! {
pub BlockWeights: frame_system::limits::BlockWeights =
frame_system::limits::BlockWeights::simple_max(Weight::from_ref_time(2_000_000_000_000));
}
impl frame_system::Config for Test {
type BaseCallFilter = Everything;
type BlockWeights = ();
Expand Down Expand Up @@ -91,11 +86,6 @@ impl pallet_balances::Config for Test {
type ReserveIdentifier = [u8; 8];
}

parameter_types! {
pub MaximumSchedulerWeight: Weight = Perbill::from_percent(80) * BlockWeights::get().max_block;
pub const MaxScheduledPerBlock: u32 = 10;
}

ord_parameter_types! {
pub const One: u64 = 1;
}
Expand Down
5 changes: 0 additions & 5 deletions frame/proxy/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ use codec::{Decode, Encode};
use frame_support::{
assert_noop, assert_ok,
dispatch::DispatchError,
parameter_types,
traits::{ConstU32, ConstU64, Contains},
RuntimeDebug,
};
Expand All @@ -52,10 +51,6 @@ frame_support::construct_runtime!(
}
);

parameter_types! {
pub BlockWeights: frame_system::limits::BlockWeights =
frame_system::limits::BlockWeights::simple_max(frame_support::weights::Weight::from_ref_time(1024));
}
impl frame_system::Config for Test {
type BaseCallFilter = BaseFilter;
type BlockWeights = ();
Expand Down
2 changes: 0 additions & 2 deletions frame/randomness-collective-flip/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,6 @@ mod tests {
);

parameter_types! {
pub BlockWeights: limits::BlockWeights = limits::BlockWeights
::simple_max(Weight::from_ref_time(1024));
pub BlockLength: limits::BlockLength = limits::BlockLength
::max(2 * 1024);
}
Expand Down
Loading

0 comments on commit a21a7f8

Please sign in to comment.