Moves all test runtimes to use derive_impl (#2409)

Step in https://github.com/paritytech/polkadot-sdk/issues/171

This PR adds `derive_impl` on all `frame_system` config impls for mock
runtimes. The overridden configs are maintained as of now to ensure
minimal changes.

---------

Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
This commit is contained in:
gupnik
2023-11-28 18:43:57 +05:30
committed by GitHub
parent 6a417eb9c2
commit cd8741c8b5
130 changed files with 433 additions and 261 deletions
+2 -1
View File
@@ -21,7 +21,7 @@ use super::*;
use crate as pallet_asset_conversion;
use frame_support::{
construct_runtime,
construct_runtime, derive_impl,
instances::{Instance1, Instance2},
ord_parameter_types, parameter_types,
traits::{AsEnsureOriginWithArg, ConstU128, ConstU32, ConstU64},
@@ -48,6 +48,7 @@ construct_runtime!(
}
);
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
+5 -1
View File
@@ -18,7 +18,10 @@
//! The crate's mock.
use crate as pallet_asset_rate;
use frame_support::traits::{ConstU16, ConstU64};
use frame_support::{
derive_impl,
traits::{ConstU16, ConstU64},
};
use sp_core::H256;
use sp_runtime::{
traits::{BlakeTwo256, IdentityLookup},
@@ -36,6 +39,7 @@ frame_support::construct_runtime!(
}
);
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
+2 -1
View File
@@ -22,7 +22,7 @@ use crate as pallet_assets;
use codec::Encode;
use frame_support::{
construct_runtime, parameter_types,
construct_runtime, derive_impl, parameter_types,
traits::{AsEnsureOriginWithArg, ConstU32, ConstU64},
};
use sp_core::H256;
@@ -46,6 +46,7 @@ construct_runtime!(
type AccountId = u64;
type AssetId = u32;
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
+5 -1
View File
@@ -20,7 +20,10 @@
use super::*;
use crate as pallet_atomic_swap;
use frame_support::traits::{ConstU32, ConstU64};
use frame_support::{
derive_impl,
traits::{ConstU32, ConstU64},
};
use sp_core::H256;
use sp_runtime::{
traits::{BlakeTwo256, IdentityLookup},
@@ -38,6 +41,7 @@ frame_support::construct_runtime!(
}
);
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
+2 -1
View File
@@ -21,7 +21,7 @@
use crate as pallet_aura;
use frame_support::{
parameter_types,
derive_impl, parameter_types,
traits::{ConstU32, ConstU64, DisabledValidators},
};
use sp_consensus_aura::{ed25519::AuthorityId, AuthorityIndex};
@@ -41,6 +41,7 @@ frame_support::construct_runtime!(
}
);
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
@@ -169,7 +169,7 @@ mod tests {
use super::*;
use crate as pallet_authority_discovery;
use frame_support::{
parameter_types,
derive_impl, parameter_types,
traits::{ConstU32, ConstU64},
};
use sp_application_crypto::Pair;
@@ -225,6 +225,7 @@ mod tests {
pub const Offset: BlockNumber = 0;
}
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
+3 -1
View File
@@ -22,7 +22,7 @@
use crate::{self as pallet_balances, AccountData, Config, CreditOf, Error, Pallet};
use codec::{Decode, Encode, MaxEncodedLen};
use frame_support::{
assert_err, assert_noop, assert_ok, assert_storage_noop,
assert_err, assert_noop, assert_ok, assert_storage_noop, derive_impl,
dispatch::{DispatchInfo, GetDispatchInfo},
parameter_types,
traits::{
@@ -90,6 +90,8 @@ parameter_types! {
);
pub static ExistentialDeposit: u64 = 1;
}
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = BlockWeights;
@@ -339,6 +339,7 @@ frame_benchmarking::benchmarks! {
#[cfg(test)]
mod mock {
use frame_support::derive_impl;
use sp_runtime::{testing::H256, BuildStorage};
type AccountId = u64;
@@ -354,6 +355,7 @@ mod mock {
}
);
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
@@ -162,6 +162,7 @@ fn noop_is_free() {
}
mod mock {
use frame_support::derive_impl;
use sp_runtime::testing::H256;
type Block = frame_system::mocking::MockBlock<Test>;
@@ -174,6 +175,7 @@ mod mock {
}
);
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
@@ -110,6 +110,7 @@ benchmarks! {
#[cfg(test)]
pub mod mock {
use frame_support::derive_impl;
use sp_runtime::{testing::H256, BuildStorage};
type AccountId = u64;
@@ -124,6 +125,7 @@ pub mod mock {
}
);
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
+2 -1
View File
@@ -19,7 +19,7 @@
#![cfg(test)]
use frame_support::{parameter_types, traits::ConstU32};
use frame_support::{derive_impl, parameter_types, traits::ConstU32};
use sp_runtime::{
testing::H256,
traits::{BlakeTwo256, IdentityLookup},
@@ -75,6 +75,7 @@ frame_support::construct_runtime!(
}
);
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
@@ -19,7 +19,7 @@
#![cfg(test)]
use frame_support::traits::ConstU32;
use frame_support::{derive_impl, traits::ConstU32};
use sp_runtime::{
testing::H256,
traits::{BlakeTwo256, IdentityLookup},
@@ -85,6 +85,7 @@ frame_support::construct_runtime!(
}
);
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
+2 -1
View File
@@ -23,7 +23,7 @@ use super::*;
use crate as pallet_bounties;
use frame_support::{
assert_noop, assert_ok, parameter_types,
assert_noop, assert_ok, derive_impl, parameter_types,
traits::{
tokens::{PayFromAccount, UnityAssetBalanceConversion},
ConstU32, ConstU64, OnInitialize,
@@ -59,6 +59,7 @@ parameter_types! {
type Balance = u64;
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
+2 -1
View File
@@ -19,7 +19,7 @@
use crate::{test_fungibles::TestFungibles, *};
use frame_support::{
assert_ok, ensure, ord_parameter_types, parameter_types,
assert_ok, derive_impl, ensure, ord_parameter_types, parameter_types,
traits::{
fungible::{Balanced, Credit, Inspect, ItemOf, Mutate},
nonfungible::Inspect as NftInspect,
@@ -47,6 +47,7 @@ frame_support::construct_runtime!(
}
);
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
+2 -1
View File
@@ -23,7 +23,7 @@ use super::*;
use crate as pallet_child_bounties;
use frame_support::{
assert_noop, assert_ok, parameter_types,
assert_noop, assert_ok, derive_impl, parameter_types,
traits::{
tokens::{PayFromAccount, UnityAssetBalanceConversion},
ConstU32, ConstU64, OnInitialize,
@@ -62,6 +62,7 @@ parameter_types! {
type Balance = u64;
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
+3 -1
View File
@@ -18,7 +18,7 @@
use super::{Event as CollectiveEvent, *};
use crate as pallet_collective;
use frame_support::{
assert_noop, assert_ok,
assert_noop, assert_ok, derive_impl,
dispatch::Pays,
parameter_types,
traits::{ConstU32, ConstU64, StorageVersion},
@@ -90,6 +90,8 @@ parameter_types! {
frame_system::limits::BlockWeights::simple_max(Weight::MAX);
pub static MaxProposalWeight: Weight = default_max_proposal_weight();
}
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = BlockWeights;
@@ -23,7 +23,7 @@ use crate::{
};
use core::marker::PhantomData;
use frame_support::{
construct_runtime, parameter_types,
construct_runtime, derive_impl, parameter_types,
traits::{AsEnsureOriginWithArg, Contains, ContainsPair, Everything, EverythingBut, Nothing},
weights::{
constants::{WEIGHT_PROOF_SIZE_PER_MB, WEIGHT_REF_TIME_PER_SECOND},
@@ -53,6 +53,7 @@ parameter_types! {
pub const BlockHashCount: u64 = 250;
}
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Runtime {
type RuntimeOrigin = RuntimeOrigin;
type RuntimeCall = RuntimeCall;
@@ -17,7 +17,7 @@
//! Relay chain runtime mock.
use frame_support::{
construct_runtime, parameter_types,
construct_runtime, derive_impl, parameter_types,
traits::{Contains, Everything, Nothing},
weights::Weight,
};
@@ -47,6 +47,7 @@ parameter_types! {
pub const BlockHashCount: u64 = 250;
}
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Runtime {
type RuntimeOrigin = RuntimeOrigin;
type RuntimeCall = RuntimeCall;
+3
View File
@@ -42,6 +42,7 @@ use assert_matches::assert_matches;
use codec::Encode;
use frame_support::{
assert_err, assert_err_ignore_postinfo, assert_err_with_weight, assert_noop, assert_ok,
derive_impl,
dispatch::{DispatchErrorWithPostInfo, PostDispatchInfo},
parameter_types,
storage::child,
@@ -332,6 +333,8 @@ parameter_types! {
);
pub static ExistentialDeposit: u64 = 1;
}
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = BlockWeights;
@@ -20,7 +20,7 @@
use std::collections::BTreeMap;
use frame_support::{
assert_noop, assert_ok, parameter_types,
assert_noop, assert_ok, derive_impl, parameter_types,
traits::{ConstU32, ConstU64, Contains, Polling, VoteTally},
};
use sp_core::H256;
@@ -51,6 +51,7 @@ impl Contains<RuntimeCall> for BaseFilter {
}
}
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Test {
type BaseCallFilter = BaseFilter;
type BlockWeights = ();
+3 -1
View File
@@ -20,7 +20,7 @@
use std::collections::BTreeMap;
use frame_support::{
assert_noop, assert_ok, ord_parameter_types,
assert_noop, assert_ok, derive_impl, ord_parameter_types,
pallet_prelude::Weight,
parameter_types,
traits::{tokens::GetSalary, ConstU32, ConstU64, Everything, IsInVec, TryMapSuccess},
@@ -50,6 +50,8 @@ parameter_types! {
pub BlockWeights: frame_system::limits::BlockWeights =
frame_system::limits::BlockWeights::simple_max(Weight::from_parts(1_000_000, u64::max_value()));
}
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Test {
type BaseCallFilter = Everything;
type BlockWeights = ();
+3 -1
View File
@@ -20,7 +20,7 @@
use super::*;
use crate as pallet_democracy;
use frame_support::{
assert_noop, assert_ok, ord_parameter_types, parameter_types,
assert_noop, assert_ok, derive_impl, ord_parameter_types, parameter_types,
traits::{
ConstU32, ConstU64, Contains, EqualPrivilegeOnly, OnInitialize, SortedMembers,
StorePreimage,
@@ -77,6 +77,8 @@ parameter_types! {
Weight::from_parts(frame_support::weights::constants::WEIGHT_REF_TIME_PER_SECOND, u64::MAX),
);
}
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Test {
type BaseCallFilter = BaseFilter;
type BlockWeights = BlockWeights;
@@ -21,7 +21,7 @@ use frame_election_provider_support::{
bounds::{DataProviderBounds, ElectionBounds},
data_provider, onchain, ElectionDataProvider, NposSolution, SequentialPhragmen,
};
pub use frame_support::{assert_noop, assert_ok, pallet_prelude::GetDefault};
pub use frame_support::{assert_noop, assert_ok, derive_impl, pallet_prelude::GetDefault};
use frame_support::{
parameter_types,
traits::{ConstU32, Hooks},
@@ -204,6 +204,7 @@ pub fn witness() -> SolutionOrSnapshotSize {
.unwrap_or_default()
}
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Runtime {
type SS58Prefix = ();
type BaseCallFilter = frame_support::traits::Everything;
@@ -182,7 +182,7 @@ impl<T: Config> ElectionProvider for OnChainExecution<T> {
mod tests {
use super::*;
use crate::{ElectionProvider, PhragMMS, SequentialPhragmen};
use frame_support::{assert_noop, parameter_types};
use frame_support::{assert_noop, derive_impl, parameter_types};
use sp_npos_elections::Support;
use sp_runtime::Perbill;
type AccountId = u64;
@@ -200,6 +200,7 @@ mod tests {
}
);
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Runtime {
type SS58Prefix = ();
type BaseCallFilter = frame_support::traits::Everything;
@@ -1307,7 +1307,7 @@ mod tests {
use super::*;
use crate as elections_phragmen;
use frame_support::{
assert_noop, assert_ok,
assert_noop, assert_ok, derive_impl,
dispatch::DispatchResultWithPostInfo,
parameter_types,
traits::{ConstU32, ConstU64, OnInitialize},
@@ -1321,6 +1321,7 @@ mod tests {
};
use substrate_test_utils::assert_eq_uvec;
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
+2 -1
View File
@@ -19,7 +19,7 @@
use crate::*;
use frame_support::{
assert_ok,
assert_ok, derive_impl,
dispatch::{DispatchInfo, GetDispatchInfo},
traits::{ConstU64, OnInitialize},
};
@@ -45,6 +45,7 @@ frame_support::construct_runtime!(
}
);
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
@@ -18,7 +18,7 @@
//! Tests for pallet-dev-mode.
use crate::*;
use frame_support::{assert_ok, traits::ConstU64};
use frame_support::{assert_ok, derive_impl, traits::ConstU64};
use sp_core::H256;
use sp_runtime::{
traits::{BlakeTwo256, IdentityLookup},
@@ -39,6 +39,7 @@ frame_support::construct_runtime!(
}
);
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
@@ -19,7 +19,7 @@ use crate as example_offchain_worker;
use crate::*;
use codec::Decode;
use frame_support::{
assert_ok, parameter_types,
assert_ok, derive_impl, parameter_types,
traits::{ConstU32, ConstU64},
};
use sp_core::{
@@ -46,6 +46,7 @@ frame_support::construct_runtime!(
}
);
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
+2 -1
View File
@@ -761,7 +761,7 @@ mod tests {
};
use frame_support::{
assert_err, parameter_types,
assert_err, derive_impl, parameter_types,
traits::{fungible, ConstU32, ConstU64, ConstU8, Currency},
weights::{ConstantMultiplier, IdentityFee, RuntimeDbWeight, Weight, WeightToFee},
};
@@ -917,6 +917,7 @@ mod tests {
write: 100,
};
}
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Runtime {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = BlockWeights;
+2 -1
View File
@@ -19,7 +19,7 @@ use super::*;
use crate as pallet_glutton;
use frame_support::{
assert_ok,
assert_ok, derive_impl,
traits::{ConstU32, ConstU64},
};
use sp_core::H256;
@@ -38,6 +38,7 @@ frame_support::construct_runtime!(
}
);
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
+2 -1
View File
@@ -27,7 +27,7 @@ use frame_election_provider_support::{
onchain, SequentialPhragmen,
};
use frame_support::{
parameter_types,
derive_impl, parameter_types,
traits::{ConstU128, ConstU32, ConstU64, KeyOwnerProofSystem, OnFinalize, OnInitialize},
};
use pallet_session::historical as pallet_session_historical;
@@ -66,6 +66,7 @@ impl_opaque_keys! {
}
}
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
+2 -1
View File
@@ -25,7 +25,7 @@ use crate::{
use codec::{Decode, Encode};
use frame_support::{
assert_noop, assert_ok, ord_parameter_types, parameter_types,
assert_noop, assert_ok, derive_impl, ord_parameter_types, parameter_types,
traits::{ConstU32, ConstU64, EitherOfDiverse, Get},
BoundedVec,
};
@@ -47,6 +47,7 @@ frame_support::construct_runtime!(
}
);
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
+2 -1
View File
@@ -20,7 +20,7 @@
#![cfg(test)]
use frame_support::{
parameter_types,
derive_impl, parameter_types,
traits::{ConstU32, ConstU64},
weights::Weight,
};
@@ -113,6 +113,7 @@ pub fn new_test_ext() -> sp_io::TestExternalities {
result
}
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Runtime {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
+5 -1
View File
@@ -20,7 +20,10 @@
#![cfg(test)]
use crate::{self as pallet_indices, Config};
use frame_support::traits::{ConstU32, ConstU64};
use frame_support::{
derive_impl,
traits::{ConstU32, ConstU64},
};
use sp_core::H256;
use sp_runtime::BuildStorage;
@@ -35,6 +38,7 @@ frame_support::construct_runtime!(
}
);
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
@@ -169,7 +169,7 @@ mod tests {
};
use frame_support::{
parameter_types,
derive_impl, parameter_types,
traits::{ConstU32, ConstU64, OnInitialize, Randomness},
};
use frame_system::limits;
@@ -189,6 +189,7 @@ mod tests {
::max(2 * 1024);
}
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
+2 -1
View File
@@ -21,7 +21,7 @@ use super::*;
use crate as pallet_lottery;
use frame_support::{
parameter_types,
derive_impl, parameter_types,
traits::{ConstU32, ConstU64, OnFinalize, OnInitialize},
};
use frame_support_test::TestRandomness;
@@ -47,6 +47,7 @@ parameter_types! {
pub const AvailableBlockRatio: Perbill = Perbill::one();
}
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
+2 -1
View File
@@ -531,7 +531,7 @@ mod tests {
};
use frame_support::{
assert_noop, assert_ok, ord_parameter_types, parameter_types,
assert_noop, assert_ok, derive_impl, ord_parameter_types, parameter_types,
traits::{ConstU32, ConstU64, StorageVersion},
};
use frame_system::EnsureSignedBy;
@@ -551,6 +551,7 @@ mod tests {
pub static Prime: Option<u64> = None;
}
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
@@ -38,7 +38,7 @@ use crate::{
use crate as pallet_message_queue;
use frame_support::{
parameter_types,
derive_impl, parameter_types,
traits::{ConstU32, ConstU64},
};
use rand::{rngs::StdRng, Rng, SeedableRng};
@@ -57,6 +57,7 @@ frame_support::construct_runtime!(
}
);
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
+3 -1
View File
@@ -24,7 +24,7 @@ use super::*;
use crate as pallet_message_queue;
use frame_support::{
parameter_types,
derive_impl, parameter_types,
traits::{ConstU32, ConstU64},
};
use sp_core::H256;
@@ -43,6 +43,8 @@ frame_support::construct_runtime!(
MessageQueue: pallet_message_queue::{Pallet, Call, Storage, Event<T>},
}
);
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
@@ -21,7 +21,7 @@ use super::*;
use crate as pallet_nft_fractionalization;
use frame_support::{
construct_runtime, parameter_types,
construct_runtime, derive_impl, parameter_types,
traits::{AsEnsureOriginWithArg, ConstU32, ConstU64},
BoundedVec, PalletId,
};
@@ -49,6 +49,8 @@ construct_runtime!(
Nfts: pallet_nfts,
}
);
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
+2 -1
View File
@@ -21,7 +21,7 @@ use super::*;
use crate as pallet_nfts;
use frame_support::{
construct_runtime, parameter_types,
construct_runtime, derive_impl, parameter_types,
traits::{AsEnsureOriginWithArg, ConstU32, ConstU64},
};
use sp_core::H256;
@@ -46,6 +46,7 @@ pub type Signature = MultiSignature;
pub type AccountPublic = <Signature as Verify>::Signer;
pub type AccountId = <AccountPublic as IdentifyAccount>::AccountId;
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
+2 -1
View File
@@ -253,7 +253,7 @@ mod tests {
use crate as pallet_nicks;
use frame_support::{
assert_noop, assert_ok, ord_parameter_types,
assert_noop, assert_ok, derive_impl, ord_parameter_types,
traits::{ConstU32, ConstU64},
};
use frame_system::EnsureSignedBy;
@@ -274,6 +274,7 @@ mod tests {
}
);
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
+2 -1
View File
@@ -20,7 +20,7 @@
use crate::{self as pallet_nis, Perquintill, WithMaximumOf};
use frame_support::{
ord_parameter_types, parameter_types,
derive_impl, ord_parameter_types, parameter_types,
traits::{
fungible::Inspect, ConstU16, ConstU32, ConstU64, Everything, OnFinalize, OnInitialize,
StorageMapShim,
@@ -50,6 +50,7 @@ frame_support::construct_runtime!(
}
);
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Test {
type BaseCallFilter = Everything;
type BlockWeights = ();
@@ -21,7 +21,7 @@ use super::*;
use crate as pallet_node_authorization;
use frame_support::{
ord_parameter_types,
derive_impl, ord_parameter_types,
traits::{ConstU32, ConstU64},
};
use frame_system::EnsureSignedBy;
@@ -43,6 +43,7 @@ frame_support::construct_runtime!(
}
);
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything;
type DbWeight = ();
@@ -17,7 +17,7 @@
use crate::VoterBagsListInstance;
use frame_election_provider_support::VoteWeight;
use frame_support::{pallet_prelude::*, parameter_types, traits::ConstU64, PalletId};
use frame_support::{derive_impl, pallet_prelude::*, parameter_types, traits::ConstU64, PalletId};
use sp_runtime::{
traits::{Convert, IdentityLookup},
BuildStorage, FixedU128, Perbill,
@@ -28,6 +28,7 @@ type Nonce = u32;
type BlockNumber = u64;
type Balance = u128;
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Runtime {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
+2 -1
View File
@@ -17,7 +17,7 @@
use super::*;
use crate::{self as pools};
use frame_support::{assert_ok, parameter_types, traits::fungible::Mutate, PalletId};
use frame_support::{assert_ok, derive_impl, parameter_types, traits::fungible::Mutate, PalletId};
use frame_system::RawOrigin;
use sp_runtime::{BuildStorage, FixedU128};
use sp_staking::{OnStakingUpdate, Stake};
@@ -209,6 +209,7 @@ impl sp_staking::StakingInterface for StakingMock {
}
}
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Runtime {
type SS58Prefix = ();
type BaseCallFilter = frame_support::traits::Everything;
@@ -17,7 +17,7 @@
use frame_election_provider_support::VoteWeight;
use frame_support::{
assert_ok,
assert_ok, derive_impl,
pallet_prelude::*,
parameter_types,
traits::{ConstU64, ConstU8},
@@ -38,6 +38,7 @@ pub(crate) type T = Runtime;
pub(crate) const POOL1_BONDED: AccountId = 20318131474730217858575332831085u128;
pub(crate) const POOL1_REWARD: AccountId = 20397359637244482196168876781421u128;
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Runtime {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
@@ -25,7 +25,7 @@ use frame_election_provider_support::{
onchain, SequentialPhragmen,
};
use frame_support::{
parameter_types,
derive_impl, parameter_types,
traits::{ConstU32, ConstU64},
};
use frame_system as system;
@@ -40,6 +40,7 @@ type AccountId = u64;
type Nonce = u32;
type Balance = u64;
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
+2 -1
View File
@@ -23,7 +23,7 @@ use crate as offences;
use crate::Config;
use codec::Encode;
use frame_support::{
parameter_types,
derive_impl, parameter_types,
traits::{ConstU32, ConstU64},
weights::{constants::RocksDbWeight, Weight},
};
@@ -75,6 +75,7 @@ frame_support::construct_runtime!(
}
);
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Runtime {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
+5 -1
View File
@@ -20,7 +20,10 @@
#![cfg(feature = "std")]
use crate::{paged_list::StoragePagedListMeta, Config, ListPrefix};
use frame_support::traits::{ConstU16, ConstU64};
use frame_support::{
derive_impl,
traits::{ConstU16, ConstU64},
};
use sp_core::H256;
use sp_runtime::{
traits::{BlakeTwo256, IdentityLookup},
@@ -38,6 +41,7 @@ frame_support::construct_runtime!(
}
);
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
+2 -1
View File
@@ -21,7 +21,7 @@ use super::*;
use crate as pallet_preimage;
use frame_support::{
ord_parameter_types,
derive_impl, ord_parameter_types,
traits::{fungible::HoldConsideration, ConstU32, ConstU64, Everything},
weights::constants::RocksDbWeight,
};
@@ -43,6 +43,7 @@ frame_support::construct_runtime!(
}
);
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Test {
type BaseCallFilter = Everything;
type BlockWeights = ();
@@ -20,7 +20,7 @@
use std::collections::BTreeMap;
use frame_support::{
assert_noop, assert_ok,
assert_noop, assert_ok, derive_impl,
error::BadOrigin,
parameter_types,
traits::{ConstU16, ConstU32, ConstU64, EitherOf, Everything, MapSuccess, Polling},
@@ -45,6 +45,7 @@ frame_support::construct_runtime!(
}
);
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Test {
type BaseCallFilter = Everything;
type BlockWeights = ();
+2 -1
View File
@@ -21,7 +21,7 @@ use super::*;
use crate as recovery;
use frame_support::{
parameter_types,
derive_impl, parameter_types,
traits::{ConstU32, ConstU64, OnFinalize, OnInitialize},
};
use sp_core::H256;
@@ -41,6 +41,7 @@ frame_support::construct_runtime!(
}
);
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
+2 -1
View File
@@ -21,7 +21,7 @@ use super::*;
use crate as pallet_referenda;
use codec::{Decode, Encode, MaxEncodedLen};
use frame_support::{
assert_ok, ord_parameter_types, parameter_types,
assert_ok, derive_impl, ord_parameter_types, parameter_types,
traits::{
ConstU32, ConstU64, Contains, EqualPrivilegeOnly, OnInitialize, OriginTrait, Polling,
SortedMembers,
@@ -59,6 +59,7 @@ impl Contains<RuntimeCall> for BaseFilter {
parameter_types! {
pub MaxWeight: Weight = Weight::from_parts(2_000_000_000_000, u64::MAX);
}
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Test {
type BaseCallFilter = BaseFilter;
type BlockWeights = ();
+5 -1
View File
@@ -18,7 +18,10 @@
//! Test environment for remarks pallet.
use crate as pallet_remark;
use frame_support::traits::{ConstU16, ConstU32, ConstU64};
use frame_support::{
derive_impl,
traits::{ConstU16, ConstU32, ConstU64},
};
use sp_core::H256;
use sp_runtime::{
traits::{BlakeTwo256, IdentityLookup},
@@ -36,6 +39,7 @@ frame_support::construct_runtime!(
}
);
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
+2 -1
View File
@@ -23,7 +23,7 @@ use frame_election_provider_support::{
onchain, SequentialPhragmen,
};
use frame_support::{
parameter_types,
derive_impl, parameter_types,
traits::{ConstU32, ConstU64, Hooks, OneSessionHandler},
};
use pallet_staking::StakerStatus;
@@ -84,6 +84,7 @@ impl sp_runtime::BoundToRuntimeAppPublic for OtherSessionHandler {
type Public = UintAuthorityId;
}
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
+2 -1
View File
@@ -23,7 +23,7 @@ use super::*;
use crate as pallet_safe_mode;
use frame_support::{
parameter_types,
derive_impl, parameter_types,
traits::{ConstU64, Everything, InsideBoth, InstanceFilter, IsInVec, SafeModeNotify},
};
use frame_system::EnsureSignedBy;
@@ -33,6 +33,7 @@ use sp_runtime::{
BuildStorage,
};
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Test {
type BaseCallFilter = InsideBoth<Everything, SafeMode>;
type BlockWeights = ();
+3 -1
View File
@@ -20,7 +20,7 @@
use std::collections::BTreeMap;
use frame_support::{
assert_noop, assert_ok,
assert_noop, assert_ok, derive_impl,
pallet_prelude::Weight,
parameter_types,
traits::{tokens::ConvertRank, ConstU32, ConstU64, Everything},
@@ -49,6 +49,8 @@ parameter_types! {
pub BlockWeights: frame_system::limits::BlockWeights =
frame_system::limits::BlockWeights::simple_max(Weight::from_parts(1_000_000, 0));
}
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Test {
type BaseCallFilter = Everything;
type BlockWeights = ();
+2 -1
View File
@@ -21,7 +21,7 @@ use super::*;
use crate as pallet_scored_pool;
use frame_support::{
construct_runtime, ord_parameter_types, parameter_types,
construct_runtime, derive_impl, ord_parameter_types, parameter_types,
traits::{ConstU32, ConstU64},
};
use frame_system::EnsureSignedBy;
@@ -51,6 +51,7 @@ ord_parameter_types! {
pub const ScoreOrigin: u64 = 3;
}
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
@@ -24,7 +24,7 @@ use frame_election_provider_support::{
onchain, SequentialPhragmen,
};
use frame_support::{
parameter_types,
derive_impl, parameter_types,
traits::{ConstU32, ConstU64},
};
use sp_runtime::{traits::IdentityLookup, BuildStorage};
@@ -45,6 +45,7 @@ frame_support::construct_runtime!(
}
);
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
+2 -1
View File
@@ -35,7 +35,7 @@ use sp_staking::SessionIndex;
use sp_state_machine::BasicExternalities;
use frame_support::{
parameter_types,
derive_impl, parameter_types,
traits::{ConstU32, ConstU64},
};
@@ -232,6 +232,7 @@ pub fn new_test_ext() -> sp_io::TestExternalities {
sp_io::TestExternalities::new(t)
}
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
+2 -1
View File
@@ -21,7 +21,7 @@ use super::*;
use crate as pallet_society;
use frame_support::{
assert_noop, assert_ok, ord_parameter_types, parameter_types,
assert_noop, assert_ok, derive_impl, ord_parameter_types, parameter_types,
traits::{ConstU32, ConstU64},
};
use frame_support_test::TestRandomness;
@@ -58,6 +58,7 @@ ord_parameter_types! {
pub const MaxBids: u32 = 10;
}
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
+2 -1
View File
@@ -23,7 +23,7 @@ use frame_election_provider_support::{
onchain, SequentialPhragmen, VoteWeight,
};
use frame_support::{
assert_ok, ord_parameter_types, parameter_types,
assert_ok, derive_impl, ord_parameter_types, parameter_types,
traits::{
ConstU64, Currency, EitherOfDiverse, FindAuthor, Get, Hooks, Imbalance, OnUnbalanced,
OneSessionHandler,
@@ -124,6 +124,7 @@ parameter_types! {
pub static Offset: BlockNumber = 0;
}
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
@@ -1051,7 +1051,7 @@ mod mock {
use super::*;
use crate as pallet_state_trie_migration;
use frame_support::{
parameter_types,
derive_impl, parameter_types,
traits::{ConstU32, ConstU64, Hooks},
weights::Weight,
};
@@ -1081,6 +1081,7 @@ mod mock {
pub const SS58Prefix: u8 = 42;
}
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
+2 -1
View File
@@ -21,7 +21,7 @@ use super::*;
use crate as pallet_statement;
use frame_support::{
ord_parameter_types,
derive_impl, ord_parameter_types,
traits::{ConstU32, ConstU64, Everything},
weights::constants::RocksDbWeight,
};
@@ -47,6 +47,7 @@ frame_support::construct_runtime!(
}
);
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Test {
type BaseCallFilter = Everything;
type BlockWeights = ();
+5 -1
View File
@@ -19,7 +19,10 @@
use super::*;
use crate as sudo;
use frame_support::traits::{ConstU32, Contains};
use frame_support::{
derive_impl,
traits::{ConstU32, Contains},
};
use sp_core::{ConstU64, H256};
use sp_io;
use sp_runtime::{
@@ -108,6 +111,7 @@ impl Contains<RuntimeCall> for BlockEverything {
}
}
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Test {
type BaseCallFilter = BlockEverything;
type BlockWeights = ();
@@ -15,7 +15,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
use frame_support::construct_runtime;
use frame_support::{construct_runtime, derive_impl};
use sp_core::sr25519;
use sp_runtime::{generic, traits::BlakeTwo256};
@@ -36,6 +36,7 @@ pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<u32, RuntimeCall, Sign
impl pallet::Config for Runtime {}
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Runtime {
type BaseCallFilter = frame_support::traits::Everything;
type RuntimeOrigin = RuntimeOrigin;
@@ -1,7 +1,7 @@
error: The number of pallets exceeds the maximum number of tuple elements. To increase this limit, enable the tuples-96 feature of [frame_support].
--> tests/construct_runtime_ui/number_of_pallets_exceeds_tuple_size.rs:66:2
--> tests/construct_runtime_ui/number_of_pallets_exceeds_tuple_size.rs:67:2
|
66 | pub struct Runtime
67 | pub struct Runtime
| ^^^
error[E0412]: cannot find type `RuntimeCall` in this scope
@@ -22,38 +22,38 @@ error[E0412]: cannot find type `Runtime` in this scope
| ^^^^^^^ not found in this scope
error[E0412]: cannot find type `Runtime` in this scope
--> tests/construct_runtime_ui/number_of_pallets_exceeds_tuple_size.rs:39:31
--> tests/construct_runtime_ui/number_of_pallets_exceeds_tuple_size.rs:40:31
|
39 | impl frame_system::Config for Runtime {
40 | impl frame_system::Config for Runtime {
| ^^^^^^^ not found in this scope
error[E0412]: cannot find type `RuntimeOrigin` in this scope
--> tests/construct_runtime_ui/number_of_pallets_exceeds_tuple_size.rs:41:23
--> tests/construct_runtime_ui/number_of_pallets_exceeds_tuple_size.rs:42:23
|
41 | type RuntimeOrigin = RuntimeOrigin;
42 | type RuntimeOrigin = RuntimeOrigin;
| ^^^^^^^^^^^^^ help: you might have meant to use the associated type: `Self::RuntimeOrigin`
error[E0412]: cannot find type `RuntimeCall` in this scope
--> tests/construct_runtime_ui/number_of_pallets_exceeds_tuple_size.rs:43:21
--> tests/construct_runtime_ui/number_of_pallets_exceeds_tuple_size.rs:44:21
|
43 | type RuntimeCall = RuntimeCall;
44 | type RuntimeCall = RuntimeCall;
| ^^^^^^^^^^^ help: you might have meant to use the associated type: `Self::RuntimeCall`
error[E0412]: cannot find type `RuntimeEvent` in this scope
--> tests/construct_runtime_ui/number_of_pallets_exceeds_tuple_size.rs:49:22
--> tests/construct_runtime_ui/number_of_pallets_exceeds_tuple_size.rs:50:22
|
49 | type RuntimeEvent = RuntimeEvent;
50 | type RuntimeEvent = RuntimeEvent;
| ^^^^^^^^^^^^ help: you might have meant to use the associated type: `Self::RuntimeEvent`
error[E0412]: cannot find type `PalletInfo` in this scope
--> tests/construct_runtime_ui/number_of_pallets_exceeds_tuple_size.rs:55:20
--> tests/construct_runtime_ui/number_of_pallets_exceeds_tuple_size.rs:56:20
|
55 | type PalletInfo = PalletInfo;
56 | type PalletInfo = PalletInfo;
| ^^^^^^^^^^
|
help: you might have meant to use the associated type
|
55 | type PalletInfo = Self::PalletInfo;
56 | type PalletInfo = Self::PalletInfo;
| ~~~~~~~~~~~~~~~~
help: consider importing one of these items
|
@@ -15,7 +15,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
use frame_support::construct_runtime;
use frame_support::{construct_runtime, derive_impl};
use sp_core::sr25519;
use sp_runtime::{generic, traits::BlakeTwo256};
@@ -61,6 +61,7 @@ pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<u32, RuntimeCall, Sign
impl pallet::Config for Runtime {}
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Runtime {
type BaseCallFilter = frame_support::traits::Everything;
type RuntimeOrigin = RuntimeOrigin;
@@ -1,13 +1,13 @@
error[E0080]: evaluation of constant value failed
--> tests/construct_runtime_ui/pallet_error_too_large.rs:90:1
--> tests/construct_runtime_ui/pallet_error_too_large.rs:91:1
|
90 | / construct_runtime! {
91 | | pub struct Runtime
92 | | {
93 | | System: frame_system::{Pallet, Call, Storage, Config<T>, Event<T>},
94 | | Pallet: pallet::{Pallet},
95 | | }
96 | | }
| |_^ the evaluated program panicked at 'The maximum encoded size of the error type in the `Pallet` pallet exceeds `MAX_MODULE_ERROR_ENCODED_SIZE`', $DIR/tests/construct_runtime_ui/pallet_error_too_large.rs:90:1
91 | / construct_runtime! {
92 | | pub struct Runtime
93 | | {
94 | | System: frame_system::{Pallet, Call, Storage, Config<T>, Event<T>},
95 | | Pallet: pallet::{Pallet},
96 | | }
97 | | }
| |_^ the evaluated program panicked at 'The maximum encoded size of the error type in the `Pallet` pallet exceeds `MAX_MODULE_ERROR_ENCODED_SIZE`', $DIR/tests/construct_runtime_ui/pallet_error_too_large.rs:91:1
|
= note: this error originates in the macro `$crate::panic::panic_2021` which comes from the expansion of the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -15,7 +15,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
use frame_support::construct_runtime;
use frame_support::{construct_runtime, derive_impl};
use sp_core::sr25519;
use sp_runtime::{generic, traits::BlakeTwo256};
@@ -36,6 +36,7 @@ pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<u32, RuntimeCall, Sign
impl pallet::Config for Runtime {}
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Runtime {
type BaseCallFilter = frame_support::traits::Everything;
type RuntimeOrigin = RuntimeOrigin;
@@ -4,13 +4,13 @@ error: `Pallet` does not have #[pallet::call] defined, perhaps you should remove
22 | #[frame_support::pallet]
| ^^^^^^^^^^^^^^^^^^^^^^^^
...
65 | / construct_runtime! {
66 | | pub struct Runtime
67 | | {
68 | | System: frame_system::{Pallet, Call, Storage, Config<T>, Event<T>},
69 | | Pallet: pallet::{Pallet, Call},
70 | | }
71 | | }
66 | / construct_runtime! {
67 | | pub struct Runtime
68 | | {
69 | | System: frame_system::{Pallet, Call, Storage, Config<T>, Event<T>},
70 | | Pallet: pallet::{Pallet, Call},
71 | | }
72 | | }
| |_- in this macro invocation
|
= note: this error originates in the macro `pallet::__substrate_call_check::is_call_part_defined` which comes from the expansion of the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -15,7 +15,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
use frame_support::construct_runtime;
use frame_support::{construct_runtime, derive_impl};
use sp_core::sr25519;
use sp_runtime::{generic, traits::BlakeTwo256};
@@ -36,6 +36,7 @@ pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<u32, RuntimeCall, Sign
impl pallet::Config for Runtime {}
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Runtime {
type BaseCallFilter = frame_support::traits::Everything;
type RuntimeOrigin = RuntimeOrigin;
@@ -4,27 +4,27 @@ error: `Pallet` does not have #[pallet::event] defined, perhaps you should remov
22 | #[frame_support::pallet]
| ^^^^^^^^^^^^^^^^^^^^^^^^
...
65 | / construct_runtime! {
66 | | pub struct Runtime
67 | | {
68 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config<T>, Event<T>},
69 | | Pallet: pallet expanded::{}::{Pallet, Event},
70 | | }
71 | | }
66 | / construct_runtime! {
67 | | pub struct Runtime
68 | | {
69 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config<T>, Event<T>},
70 | | Pallet: pallet expanded::{}::{Pallet, Event},
71 | | }
72 | | }
| |_- in this macro invocation
|
= note: this error originates in the macro `pallet::__substrate_event_check::is_event_part_defined` which comes from the expansion of the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0412]: cannot find type `Event` in module `pallet`
--> tests/construct_runtime_ui/undefined_event_part.rs:65:1
--> tests/construct_runtime_ui/undefined_event_part.rs:66:1
|
65 | / construct_runtime! {
66 | | pub struct Runtime
67 | | {
68 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config<T>, Event<T>},
69 | | Pallet: pallet expanded::{}::{Pallet, Event},
70 | | }
71 | | }
66 | / construct_runtime! {
67 | | pub struct Runtime
68 | | {
69 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config<T>, Event<T>},
70 | | Pallet: pallet expanded::{}::{Pallet, Event},
71 | | }
72 | | }
| |_^ not found in `pallet`
|
= note: this error originates in the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -15,7 +15,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
use frame_support::construct_runtime;
use frame_support::{construct_runtime, derive_impl};
use sp_core::sr25519;
use sp_runtime::{generic, traits::BlakeTwo256};
@@ -36,6 +36,7 @@ pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<u32, RuntimeCall, Sign
impl pallet::Config for Runtime {}
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Runtime {
type BaseCallFilter = frame_support::traits::Everything;
type RuntimeOrigin = RuntimeOrigin;
@@ -4,27 +4,27 @@ error: `Pallet` does not have #[pallet::genesis_config] defined, perhaps you sho
22 | #[frame_support::pallet]
| ^^^^^^^^^^^^^^^^^^^^^^^^
...
65 | / construct_runtime! {
66 | | pub struct Runtime
67 | | {
68 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config<T>, Event<T>},
69 | | Pallet: pallet expanded::{}::{Pallet, Config},
70 | | }
71 | | }
66 | / construct_runtime! {
67 | | pub struct Runtime
68 | | {
69 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config<T>, Event<T>},
70 | | Pallet: pallet expanded::{}::{Pallet, Config},
71 | | }
72 | | }
| |_- in this macro invocation
|
= note: this error originates in the macro `pallet::__substrate_genesis_config_check::is_genesis_config_defined` which comes from the expansion of the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0412]: cannot find type `GenesisConfig` in module `pallet`
--> tests/construct_runtime_ui/undefined_genesis_config_part.rs:65:1
--> tests/construct_runtime_ui/undefined_genesis_config_part.rs:66:1
|
65 | / construct_runtime! {
66 | | pub struct Runtime
67 | | {
68 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config<T>, Event<T>},
69 | | Pallet: pallet expanded::{}::{Pallet, Config},
70 | | }
71 | | }
66 | / construct_runtime! {
67 | | pub struct Runtime
68 | | {
69 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config<T>, Event<T>},
70 | | Pallet: pallet expanded::{}::{Pallet, Config},
71 | | }
72 | | }
| |_^ not found in `pallet`
|
= note: this error originates in the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -15,7 +15,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
use frame_support::construct_runtime;
use frame_support::{construct_runtime, derive_impl};
use sp_core::sr25519;
use sp_runtime::{generic, traits::BlakeTwo256};
@@ -36,6 +36,7 @@ pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<u32, RuntimeCall, Sign
impl pallet::Config for Runtime {}
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Runtime {
type BaseCallFilter = frame_support::traits::Everything;
type RuntimeOrigin = RuntimeOrigin;
@@ -4,31 +4,31 @@ error: `Pallet` does not have #[pallet::inherent] defined, perhaps you should re
22 | #[frame_support::pallet]
| ^^^^^^^^^^^^^^^^^^^^^^^^
...
65 | / construct_runtime! {
66 | | pub struct Runtime
67 | | {
68 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config<T>, Event<T>},
69 | | Pallet: pallet expanded::{}::{Pallet, Inherent},
70 | | }
71 | | }
66 | / construct_runtime! {
67 | | pub struct Runtime
68 | | {
69 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config<T>, Event<T>},
70 | | Pallet: pallet expanded::{}::{Pallet, Inherent},
71 | | }
72 | | }
| |_- in this macro invocation
|
= note: this error originates in the macro `pallet::__substrate_inherent_check::is_inherent_part_defined` which comes from the expansion of the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0599]: no function or associated item named `create_inherent` found for struct `pallet::Pallet` in the current scope
--> tests/construct_runtime_ui/undefined_inherent_part.rs:65:1
--> tests/construct_runtime_ui/undefined_inherent_part.rs:66:1
|
28 | pub struct Pallet<T>(_);
| -------------------- function or associated item `create_inherent` not found for this struct
...
65 | construct_runtime! {
66 | construct_runtime! {
| _^
66 | | pub struct Runtime
67 | | {
68 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config<T>, Event<T>},
69 | | Pallet: pallet expanded::{}::{Pallet, Inherent},
70 | | }
71 | | }
67 | | pub struct Runtime
68 | | {
69 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config<T>, Event<T>},
70 | | Pallet: pallet expanded::{}::{Pallet, Inherent},
71 | | }
72 | | }
| |_^ function or associated item not found in `Pallet<Runtime>`
|
= help: items from traits can only be used if the trait is implemented and in scope
@@ -37,19 +37,19 @@ error[E0599]: no function or associated item named `create_inherent` found for s
= note: this error originates in the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0599]: no function or associated item named `is_inherent` found for struct `pallet::Pallet` in the current scope
--> tests/construct_runtime_ui/undefined_inherent_part.rs:65:1
--> tests/construct_runtime_ui/undefined_inherent_part.rs:66:1
|
28 | pub struct Pallet<T>(_);
| -------------------- function or associated item `is_inherent` not found for this struct
...
65 | construct_runtime! {
66 | construct_runtime! {
| _^
66 | | pub struct Runtime
67 | | {
68 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config<T>, Event<T>},
69 | | Pallet: pallet expanded::{}::{Pallet, Inherent},
70 | | }
71 | | }
67 | | pub struct Runtime
68 | | {
69 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config<T>, Event<T>},
70 | | Pallet: pallet expanded::{}::{Pallet, Inherent},
71 | | }
72 | | }
| |_^ function or associated item not found in `Pallet<Runtime>`
|
= help: items from traits can only be used if the trait is implemented and in scope
@@ -58,19 +58,19 @@ error[E0599]: no function or associated item named `is_inherent` found for struc
= note: this error originates in the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0599]: no function or associated item named `check_inherent` found for struct `pallet::Pallet` in the current scope
--> tests/construct_runtime_ui/undefined_inherent_part.rs:65:1
--> tests/construct_runtime_ui/undefined_inherent_part.rs:66:1
|
28 | pub struct Pallet<T>(_);
| -------------------- function or associated item `check_inherent` not found for this struct
...
65 | construct_runtime! {
66 | construct_runtime! {
| _^
66 | | pub struct Runtime
67 | | {
68 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config<T>, Event<T>},
69 | | Pallet: pallet expanded::{}::{Pallet, Inherent},
70 | | }
71 | | }
67 | | pub struct Runtime
68 | | {
69 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config<T>, Event<T>},
70 | | Pallet: pallet expanded::{}::{Pallet, Inherent},
71 | | }
72 | | }
| |_^ function or associated item not found in `Pallet<Runtime>`
|
= help: items from traits can only be used if the trait is implemented and in scope
@@ -79,19 +79,19 @@ error[E0599]: no function or associated item named `check_inherent` found for st
= note: this error originates in the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0599]: no associated item named `INHERENT_IDENTIFIER` found for struct `pallet::Pallet` in the current scope
--> tests/construct_runtime_ui/undefined_inherent_part.rs:65:1
--> tests/construct_runtime_ui/undefined_inherent_part.rs:66:1
|
28 | pub struct Pallet<T>(_);
| -------------------- associated item `INHERENT_IDENTIFIER` not found for this struct
...
65 | construct_runtime! {
66 | construct_runtime! {
| _^
66 | | pub struct Runtime
67 | | {
68 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config<T>, Event<T>},
69 | | Pallet: pallet expanded::{}::{Pallet, Inherent},
70 | | }
71 | | }
67 | | pub struct Runtime
68 | | {
69 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config<T>, Event<T>},
70 | | Pallet: pallet expanded::{}::{Pallet, Inherent},
71 | | }
72 | | }
| |_^ associated item not found in `Pallet<Runtime>`
|
= help: items from traits can only be used if the trait is implemented and in scope
@@ -100,19 +100,19 @@ error[E0599]: no associated item named `INHERENT_IDENTIFIER` found for struct `p
= note: this error originates in the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0599]: no function or associated item named `is_inherent_required` found for struct `pallet::Pallet` in the current scope
--> tests/construct_runtime_ui/undefined_inherent_part.rs:65:1
--> tests/construct_runtime_ui/undefined_inherent_part.rs:66:1
|
28 | pub struct Pallet<T>(_);
| -------------------- function or associated item `is_inherent_required` not found for this struct
...
65 | construct_runtime! {
66 | construct_runtime! {
| _^
66 | | pub struct Runtime
67 | | {
68 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config<T>, Event<T>},
69 | | Pallet: pallet expanded::{}::{Pallet, Inherent},
70 | | }
71 | | }
67 | | pub struct Runtime
68 | | {
69 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config<T>, Event<T>},
70 | | Pallet: pallet expanded::{}::{Pallet, Inherent},
71 | | }
72 | | }
| |_^ function or associated item not found in `Pallet<Runtime>`
|
= help: items from traits can only be used if the trait is implemented and in scope
@@ -15,7 +15,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
use frame_support::construct_runtime;
use frame_support::{construct_runtime, derive_impl};
use sp_core::sr25519;
use sp_runtime::{generic, traits::BlakeTwo256};
@@ -36,6 +36,7 @@ pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<u32, RuntimeCall, Sign
impl pallet::Config for Runtime {}
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Runtime {
type BaseCallFilter = frame_support::traits::Everything;
type RuntimeOrigin = RuntimeOrigin;
@@ -4,27 +4,27 @@ error: `Pallet` does not have #[pallet::origin] defined, perhaps you should remo
22 | #[frame_support::pallet]
| ^^^^^^^^^^^^^^^^^^^^^^^^
...
65 | / construct_runtime! {
66 | | pub struct Runtime
67 | | {
68 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config<T>, Event<T>},
69 | | Pallet: pallet expanded::{}::{Pallet, Origin},
70 | | }
71 | | }
66 | / construct_runtime! {
67 | | pub struct Runtime
68 | | {
69 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config<T>, Event<T>},
70 | | Pallet: pallet expanded::{}::{Pallet, Origin},
71 | | }
72 | | }
| |_- in this macro invocation
|
= note: this error originates in the macro `pallet::__substrate_origin_check::is_origin_part_defined` which comes from the expansion of the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0412]: cannot find type `Origin` in module `pallet`
--> tests/construct_runtime_ui/undefined_origin_part.rs:65:1
--> tests/construct_runtime_ui/undefined_origin_part.rs:66:1
|
65 | / construct_runtime! {
66 | | pub struct Runtime
67 | | {
68 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config<T>, Event<T>},
69 | | Pallet: pallet expanded::{}::{Pallet, Origin},
70 | | }
71 | | }
66 | / construct_runtime! {
67 | | pub struct Runtime
68 | | {
69 | | System: frame_system expanded::{}::{Pallet, Call, Storage, Config<T>, Event<T>},
70 | | Pallet: pallet expanded::{}::{Pallet, Origin},
71 | | }
72 | | }
| |_^ not found in `pallet`
|
= note: this error originates in the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -15,7 +15,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
use frame_support::construct_runtime;
use frame_support::{construct_runtime, derive_impl};
use sp_core::sr25519;
use sp_runtime::{generic, traits::BlakeTwo256};
@@ -36,6 +36,7 @@ pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<u32, RuntimeCall, Sign
impl pallet::Config for Runtime {}
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Runtime {
type BaseCallFilter = frame_support::traits::Everything;
type RuntimeOrigin = RuntimeOrigin;
@@ -4,46 +4,46 @@ error: `Pallet` does not have #[pallet::validate_unsigned] defined, perhaps you
22 | #[frame_support::pallet]
| ^^^^^^^^^^^^^^^^^^^^^^^^
...
65 | / construct_runtime! {
66 | | pub struct Runtime
67 | | {
68 | | System: frame_system::{Pallet, Call, Storage, Config<T>, Event<T>},
69 | | Pallet: pallet::{Pallet, ValidateUnsigned},
70 | | }
71 | | }
66 | / construct_runtime! {
67 | | pub struct Runtime
68 | | {
69 | | System: frame_system::{Pallet, Call, Storage, Config<T>, Event<T>},
70 | | Pallet: pallet::{Pallet, ValidateUnsigned},
71 | | }
72 | | }
| |_- in this macro invocation
|
= note: this error originates in the macro `pallet::__substrate_validate_unsigned_check::is_validate_unsigned_part_defined` which comes from the expansion of the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0599]: no variant or associated item named `Pallet` found for enum `RuntimeCall` in the current scope
--> tests/construct_runtime_ui/undefined_validate_unsigned_part.rs:69:3
--> tests/construct_runtime_ui/undefined_validate_unsigned_part.rs:70:3
|
65 | // construct_runtime! {
66 | || pub struct Runtime
67 | || {
68 | || System: frame_system::{Pallet, Call, Storage, Config<T>, Event<T>},
69 | || Pallet: pallet::{Pallet, ValidateUnsigned},
66 | // construct_runtime! {
67 | || pub struct Runtime
68 | || {
69 | || System: frame_system::{Pallet, Call, Storage, Config<T>, Event<T>},
70 | || Pallet: pallet::{Pallet, ValidateUnsigned},
| || -^^^^^^ variant or associated item not found in `RuntimeCall`
| ||________|
| |
... |
error[E0599]: no function or associated item named `pre_dispatch` found for struct `pallet::Pallet` in the current scope
--> tests/construct_runtime_ui/undefined_validate_unsigned_part.rs:65:1
--> tests/construct_runtime_ui/undefined_validate_unsigned_part.rs:66:1
|
28 | pub struct Pallet<T>(_);
| -------------------- function or associated item `pre_dispatch` not found for this struct
...
65 | construct_runtime! {
66 | construct_runtime! {
| __^
| | _|
| ||
66 | || pub struct Runtime
67 | || {
68 | || System: frame_system::{Pallet, Call, Storage, Config<T>, Event<T>},
69 | || Pallet: pallet::{Pallet, ValidateUnsigned},
70 | || }
71 | || }
67 | || pub struct Runtime
68 | || {
69 | || System: frame_system::{Pallet, Call, Storage, Config<T>, Event<T>},
70 | || Pallet: pallet::{Pallet, ValidateUnsigned},
71 | || }
72 | || }
| ||_- in this macro invocation
... |
|
@@ -54,21 +54,21 @@ error[E0599]: no function or associated item named `pre_dispatch` found for stru
= note: this error originates in the macro `frame_support::construct_runtime` which comes from the expansion of the macro `construct_runtime` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0599]: no function or associated item named `validate_unsigned` found for struct `pallet::Pallet` in the current scope
--> tests/construct_runtime_ui/undefined_validate_unsigned_part.rs:65:1
--> tests/construct_runtime_ui/undefined_validate_unsigned_part.rs:66:1
|
28 | pub struct Pallet<T>(_);
| -------------------- function or associated item `validate_unsigned` not found for this struct
...
65 | construct_runtime! {
66 | construct_runtime! {
| __^
| | _|
| ||
66 | || pub struct Runtime
67 | || {
68 | || System: frame_system::{Pallet, Call, Storage, Config<T>, Event<T>},
69 | || Pallet: pallet::{Pallet, ValidateUnsigned},
70 | || }
71 | || }
67 | || pub struct Runtime
68 | || {
69 | || System: frame_system::{Pallet, Call, Storage, Config<T>, Event<T>},
70 | || Pallet: pallet::{Pallet, ValidateUnsigned},
71 | || }
72 | || }
| ||_- in this macro invocation
... |
|
+2 -1
View File
@@ -16,7 +16,7 @@
// limitations under the License.
use frame_support::{
assert_ok,
assert_ok, derive_impl,
dispatch::{DispatchClass, DispatchInfo, GetDispatchInfo, Parameter, Pays},
dispatch_context::with_context,
pallet_prelude::{StorageInfoTrait, ValueQuery},
@@ -682,6 +682,7 @@ frame_support::parameter_types!(
pub const MyGetParam3: u32 = 12;
);
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Runtime {
type BaseCallFilter = frame_support::traits::Everything;
type RuntimeOrigin = RuntimeOrigin;
@@ -16,6 +16,7 @@
// limitations under the License.
use frame_support::{
derive_impl,
dispatch::{DispatchClass, DispatchInfo, GetDispatchInfo, Pays},
pallet_prelude::ValueQuery,
parameter_types,
@@ -292,6 +293,7 @@ pub mod pallet2 {
}
}
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Runtime {
type BaseCallFilter = frame_support::traits::Everything;
type RuntimeOrigin = RuntimeOrigin;
@@ -17,7 +17,7 @@
#![cfg_attr(not(feature = "std"), no_std)]
use frame_support::traits::ConstU32;
use frame_support::{derive_impl, traits::ConstU32};
pub use pallet::*;
@@ -70,6 +70,7 @@ pub mod pallet {
impl<T: Config> Pallet<T> {}
}
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Runtime {
type BaseCallFilter = frame_support::traits::Everything;
type RuntimeOrigin = RuntimeOrigin;
@@ -15,7 +15,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
use frame_support::construct_runtime;
use frame_support::{construct_runtime, derive_impl};
use sp_core::sr25519;
use sp_runtime::{generic, traits::BlakeTwo256};
@@ -27,6 +27,7 @@ pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<u32, RuntimeCall, Sign
impl test_pallet::Config for Runtime {}
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Runtime {
type BaseCallFilter = frame_support::traits::Everything;
type RuntimeOrigin = RuntimeOrigin;
@@ -15,7 +15,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
use frame_support::traits::ConstU32;
use frame_support::{derive_impl, traits::ConstU32};
use scale_info::{form::MetaForm, meta_type};
use sp_metadata_ir::{
RuntimeApiMetadataIR, RuntimeApiMethodMetadataIR, RuntimeApiMethodParamMetadataIR,
@@ -27,6 +27,7 @@ pub type Header = sp_runtime::generic::Header<u32, sp_runtime::traits::BlakeTwo2
pub type Block = sp_runtime::generic::Block<Header, UncheckedExtrinsic>;
pub type UncheckedExtrinsic = sp_runtime::generic::UncheckedExtrinsic<u32, RuntimeCall, (), ()>;
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Runtime {
type BlockWeights = ();
type BlockLength = ();
@@ -16,8 +16,8 @@
// limitations under the License.
use frame_support::{
assert_noop, assert_ok, dispatch::DispatchResult, ensure, pallet_prelude::ConstU32,
storage::with_storage_layer,
assert_noop, assert_ok, derive_impl, dispatch::DispatchResult, ensure,
pallet_prelude::ConstU32, storage::with_storage_layer,
};
use pallet::*;
use sp_io::TestExternalities;
@@ -64,6 +64,7 @@ pub type Header = sp_runtime::generic::Header<BlockNumber, sp_runtime::traits::B
pub type UncheckedExtrinsic = sp_runtime::generic::UncheckedExtrinsic<u32, RuntimeCall, (), ()>;
pub type Block = sp_runtime::generic::Block<Header, UncheckedExtrinsic>;
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Runtime {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
+6 -1
View File
@@ -16,7 +16,10 @@
// limitations under the License.
use criterion::{black_box, criterion_group, criterion_main, Criterion};
use frame_support::traits::{ConstU32, ConstU64};
use frame_support::{
derive_impl,
traits::{ConstU32, ConstU64},
};
use sp_core::H256;
use sp_runtime::{
traits::{BlakeTwo256, IdentityLookup},
@@ -57,6 +60,8 @@ frame_support::parameter_types! {
4 * 1024 * 1024, Perbill::from_percent(75),
);
}
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Runtime {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
@@ -20,6 +20,7 @@
#![cfg(test)]
use codec::Encode;
use frame_support::derive_impl;
use sp_runtime::{traits::IdentityLookup, BuildStorage};
type AccountId = u64;
@@ -34,6 +35,7 @@ frame_support::construct_runtime!(
}
);
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
+2 -1
View File
@@ -21,7 +21,7 @@ use super::*;
use crate as pallet_timestamp;
use frame_support::{
parameter_types,
derive_impl, parameter_types,
traits::{ConstU32, ConstU64},
};
use sp_core::H256;
@@ -42,6 +42,7 @@ frame_support::construct_runtime!(
}
);
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
+3 -1
View File
@@ -27,7 +27,7 @@ use sp_runtime::{
use sp_storage::Storage;
use frame_support::{
assert_noop, assert_ok, parameter_types,
assert_noop, assert_ok, derive_impl, parameter_types,
storage::StoragePrefixedMap,
traits::{
tokens::{PayFromAccount, UnityAssetBalanceConversion},
@@ -56,6 +56,8 @@ frame_support::construct_runtime!(
parameter_types! {
pub const AvailableBlockRatio: Perbill = Perbill::one();
}
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
@@ -18,6 +18,7 @@ use crate as pallet_asset_conversion_tx_payment;
use codec;
use frame_support::{
derive_impl,
dispatch::DispatchClass,
instances::Instance2,
ord_parameter_types,
@@ -78,6 +79,7 @@ parameter_types! {
pub static TransactionByteFee: u64 = 1;
}
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Runtime {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = BlockWeights;
@@ -18,6 +18,7 @@ use crate as pallet_asset_tx_payment;
use codec;
use frame_support::{
derive_impl,
dispatch::DispatchClass,
pallet_prelude::*,
parameter_types,
@@ -70,6 +71,7 @@ parameter_types! {
pub static TransactionByteFee: u64 = 1;
}
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Runtime {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = BlockWeights;
@@ -22,6 +22,7 @@ use sp_core::H256;
use sp_runtime::traits::{BlakeTwo256, IdentityLookup};
use frame_support::{
derive_impl,
dispatch::DispatchClass,
parameter_types,
traits::{ConstU32, ConstU64, Imbalance, OnUnbalanced},
@@ -69,6 +70,7 @@ parameter_types! {
pub static OperationalFeeMultiplier: u8 = 5;
}
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Runtime {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = BlockWeights;
+2 -1
View File
@@ -27,7 +27,7 @@ use sp_runtime::{
};
use frame_support::{
assert_err_ignore_postinfo, assert_noop, assert_ok,
assert_err_ignore_postinfo, assert_noop, assert_ok, derive_impl,
pallet_prelude::Pays,
parameter_types,
traits::{
@@ -54,6 +54,7 @@ frame_support::construct_runtime!(
}
);
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
+2 -1
View File
@@ -23,7 +23,7 @@ use super::*;
use crate as pallet_tx_pause;
use frame_support::{
parameter_types,
derive_impl, parameter_types,
traits::{ConstU64, Everything, InsideBoth, InstanceFilter},
};
use frame_system::EnsureSignedBy;
@@ -36,6 +36,7 @@ use sp_runtime::{
parameter_types! {
pub const BlockHashCount: u64 = 250;
}
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Test {
type BaseCallFilter = InsideBoth<Everything, TxPause>;
type BlockWeights = ();
+2 -1
View File
@@ -21,7 +21,7 @@ use super::*;
use crate as pallet_uniques;
use frame_support::{
construct_runtime,
construct_runtime, derive_impl,
traits::{AsEnsureOriginWithArg, ConstU32, ConstU64},
};
use sp_core::H256;
@@ -41,6 +41,7 @@ construct_runtime!(
}
);
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
+2 -1
View File
@@ -23,7 +23,7 @@ use super::*;
use crate as utility;
use frame_support::{
assert_err_ignore_postinfo, assert_noop, assert_ok,
assert_err_ignore_postinfo, assert_noop, assert_ok, derive_impl,
dispatch::{DispatchErrorWithPostInfo, Pays},
error::BadOrigin,
parameter_types, storage,
@@ -144,6 +144,7 @@ parameter_types! {
pub BlockWeights: frame_system::limits::BlockWeights =
frame_system::limits::BlockWeights::simple_max(Weight::MAX);
}
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Test {
type BaseCallFilter = TestBaseCallFilter;
type BlockWeights = BlockWeights;
+2 -1
View File
@@ -16,7 +16,7 @@
// limitations under the License.
use frame_support::{
parameter_types,
derive_impl, parameter_types,
traits::{ConstU32, ConstU64, WithdrawReasons},
};
use sp_core::H256;
@@ -39,6 +39,7 @@ frame_support::construct_runtime!(
}
);
#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Test {
type AccountData = pallet_balances::AccountData<u64>;
type AccountId = u64;

Some files were not shown because too many files have changed in this diff Show More