Skip to content

Commit

Permalink
frame: Adjust more tests
Browse files Browse the repository at this point in the history
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
  • Loading branch information
lexnv committed Feb 3, 2023
1 parent 417fb8d commit de1352c
Show file tree
Hide file tree
Showing 62 changed files with 372 additions and 1 deletion.
6 changes: 6 additions & 0 deletions bin/node-template/pallets/template/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ frame_support::construct_runtime!(
}
);

impl Test {
fn runtime_metadata() -> Vec<frame_support::metadata::v15::TraitMetadata> {
Default::default()
}
}

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

impl Test {
fn runtime_metadata() -> Vec<frame_support::metadata::v15::TraitMetadata> {
Default::default()
}
}

pub fn new_test_ext() -> sp_io::TestExternalities {
let mut t = frame_system::GenesisConfig::default().build_storage::<Test>().unwrap();

Expand Down
6 changes: 6 additions & 0 deletions frame/assets/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ construct_runtime!(
}
);

impl Test {
fn runtime_metadata() -> Vec<frame_support::metadata::v15::TraitMetadata> {
Default::default()
}
}

type AccountId = u64;
type AssetId = u32;

Expand Down
6 changes: 6 additions & 0 deletions frame/atomic-swap/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ frame_support::construct_runtime!(
}
);

impl Test {
fn runtime_metadata() -> Vec<frame_support::metadata::v15::TraitMetadata> {
Default::default()
}
}

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

impl Test {
fn runtime_metadata() -> Vec<frame_support::metadata::v15::TraitMetadata> {
Default::default()
}
}

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

impl Test {
fn runtime_metadata() -> Vec<frame_support::metadata::v15::TraitMetadata> {
Default::default()
}
}

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

impl Test {
fn runtime_metadata() -> Vec<frame_support::metadata::v15::TraitMetadata> {
Default::default()
}
}

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

impl Test {
fn runtime_metadata() -> Vec<frame_support::metadata::v15::TraitMetadata> {
Default::default()
}
}

parameter_types! {
pub BlockWeights: frame_system::limits::BlockWeights =
frame_system::limits::BlockWeights::simple_max(
Expand Down
6 changes: 6 additions & 0 deletions frame/balances/src/tests_local.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ frame_support::construct_runtime!(
}
);

impl Test {
fn runtime_metadata() -> Vec<frame_support::metadata::v15::TraitMetadata> {
Default::default()
}
}

parameter_types! {
pub BlockWeights: frame_system::limits::BlockWeights =
frame_system::limits::BlockWeights::simple_max(
Expand Down
6 changes: 6 additions & 0 deletions frame/balances/src/tests_reentrancy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ frame_support::construct_runtime!(
}
);

impl Test {
fn runtime_metadata() -> Vec<frame_support::metadata::v15::TraitMetadata> {
Default::default()
}
}

parameter_types! {
pub BlockWeights: frame_system::limits::BlockWeights =
frame_system::limits::BlockWeights::simple_max(
Expand Down
5 changes: 5 additions & 0 deletions frame/benchmarking/pov/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,11 @@ mod mock {
}
);

impl Test {
fn runtime_metadata() -> Vec<frame_support::metadata::v15::TraitMetadata> {
Default::default()
}
}
impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
Expand Down
6 changes: 6 additions & 0 deletions frame/bounties/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ frame_support::construct_runtime!(
}
);

impl Test {
fn runtime_metadata() -> Vec<frame_support::metadata::v15::TraitMetadata> {
Default::default()
}
}

parameter_types! {
pub const AvailableBlockRatio: Perbill = Perbill::one();
}
Expand Down
6 changes: 6 additions & 0 deletions frame/child-bounties/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ frame_support::construct_runtime!(
}
);

impl Test {
fn runtime_metadata() -> Vec<frame_support::metadata::v15::TraitMetadata> {
Default::default()
}
}

parameter_types! {
pub const MaximumBlockWeight: Weight = Weight::from_ref_time(1024);
pub const MaximumBlockLength: u32 = 2 * 1024;
Expand Down
6 changes: 6 additions & 0 deletions frame/collective/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ frame_support::construct_runtime!(
}
);

impl Test {
fn runtime_metadata() -> Vec<frame_support::metadata::v15::TraitMetadata> {
Default::default()
}
}

mod mock_democracy {
pub use pallet::*;
#[frame_support::pallet]
Expand Down
6 changes: 6 additions & 0 deletions frame/conviction-voting/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ frame_support::construct_runtime!(
}
);

impl Test {
fn runtime_metadata() -> Vec<frame_support::metadata::v15::TraitMetadata> {
Default::default()
}
}

// Test that a fitlered call can be dispatched.
pub struct BaseFilter;
impl Contains<RuntimeCall> for BaseFilter {
Expand Down
8 changes: 7 additions & 1 deletion frame/democracy/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,13 @@ frame_support::construct_runtime!(
}
);

// Test that a fitlered call can be dispatched.
impl Test {
fn runtime_metadata() -> Vec<frame_support::metadata::v15::TraitMetadata> {
Default::default()
}
}

// Test that a filtered call can be dispatched.
pub struct BaseFilter;
impl Contains<RuntimeCall> for BaseFilter {
fn contains(call: &RuntimeCall) -> bool {
Expand Down
6 changes: 6 additions & 0 deletions frame/election-provider-multi-phase/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ frame_support::construct_runtime!(
}
);

impl Runtime {
fn runtime_metadata() -> Vec<frame_support::metadata::v15::TraitMetadata> {
Default::default()
}
}

pub(crate) type Balance = u64;
pub(crate) type AccountId = u64;
pub(crate) type BlockNumber = u64;
Expand Down
6 changes: 6 additions & 0 deletions frame/election-provider-support/src/onchain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,12 @@ mod tests {
}
);

impl Runtime {
fn runtime_metadata() -> Vec<frame_support::metadata::v15::TraitMetadata> {
Default::default()
}
}

impl frame_system::Config for Runtime {
type SS58Prefix = ();
type BaseCallFilter = frame_support::traits::Everything;
Expand Down
6 changes: 6 additions & 0 deletions frame/examples/basic/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ frame_support::construct_runtime!(
}
);

impl Test {
fn runtime_metadata() -> Vec<frame_support::metadata::v15::TraitMetadata> {
Default::default()
}
}

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

impl Runtime {
fn runtime_metadata() -> Vec<frame_support::metadata::v15::TraitMetadata> {
Default::default()
}
}

parameter_types! {
pub BlockWeights: frame_system::limits::BlockWeights =
frame_system::limits::BlockWeights::builder()
Expand Down
6 changes: 6 additions & 0 deletions frame/grandpa/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ frame_support::construct_runtime!(
}
);

impl Test {
fn runtime_metadata() -> Vec<frame_support::metadata::v15::TraitMetadata> {
Default::default()
}
}

impl_opaque_keys! {
pub struct TestSessionKeys {
pub grandpa_authority: super::Pallet<Test>,
Expand Down
6 changes: 6 additions & 0 deletions frame/identity/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ frame_support::construct_runtime!(
}
);

impl Test {
fn runtime_metadata() -> Vec<frame_support::metadata::v15::TraitMetadata> {
Default::default()
}
}

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

impl Test {
fn runtime_metadata() -> Vec<frame_support::metadata::v15::TraitMetadata> {
Default::default()
}
}

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

impl Test {
fn runtime_metadata() -> Vec<frame_support::metadata::v15::TraitMetadata> {
Default::default()
}
}

parameter_types! {
pub static Members: Vec<u64> = vec![];
pub static Prime: Option<u64> = None;
Expand Down
6 changes: 6 additions & 0 deletions frame/merkle-mountain-range/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ frame_support::construct_runtime!(
}
);

impl Test {
fn runtime_metadata() -> Vec<frame_support::metadata::v15::TraitMetadata> {
Default::default()
}
}

impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything;
type RuntimeOrigin = RuntimeOrigin;
Expand Down
6 changes: 6 additions & 0 deletions frame/message-queue/src/integration_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ frame_support::construct_runtime!(
}
);

impl Test {
fn runtime_metadata() -> Vec<frame_support::metadata::v15::TraitMetadata> {
Default::default()
}
}

impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
Expand Down
7 changes: 7 additions & 0 deletions frame/message-queue/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ frame_support::construct_runtime!(
MessageQueue: pallet_message_queue::{Pallet, Call, Storage, Event<T>},
}
);

impl Test {
fn runtime_metadata() -> Vec<frame_support::metadata::v15::TraitMetadata> {
Default::default()
}
}

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

impl Test {
fn runtime_metadata() -> Vec<frame_support::metadata::v15::TraitMetadata> {
Default::default()
}
}

impl frame_system::Config for Test {
type BaseCallFilter = TestBaseCallFilter;
type BlockWeights = ();
Expand Down
6 changes: 6 additions & 0 deletions frame/nfts/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ construct_runtime!(
}
);

impl Test {
fn runtime_metadata() -> Vec<frame_support::metadata::v15::TraitMetadata> {
Default::default()
}
}

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

impl Test {
fn runtime_metadata() -> Vec<frame_support::metadata::v15::TraitMetadata> {
Default::default()
}
}

impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
Expand Down
Loading

0 comments on commit de1352c

Please sign in to comment.