git.delta.rocks / unique-network / refs/commits / 7742ed99af1b

difftreelog

test fix mocks

Yaroslav Bolyukin2021-10-11parent: #f7d05a5.patch.diff
in: master

3 files changed

modifiedpallets/inflation/src/tests.rsdiffbeforeafterboth
7 parameter_types,7 parameter_types,
8};8};
9use frame_support::{traits::OnInitialize};9use frame_support::{
10 traits::{OnInitialize, Everything},
11};
10use sp_core::H256;12use sp_core::H256;
11use sp_runtime::{13use sp_runtime::{
55}57}
5658
57impl frame_system::Config for Test {59impl frame_system::Config for Test {
58 type BaseCallFilter = ();60 type BaseCallFilter = Everything;
59 type BlockWeights = ();61 type BlockWeights = ();
60 type BlockLength = ();62 type BlockLength = ();
61 type DbWeight = ();63 type DbWeight = ();
modifiedpallets/nft/src/mock.rsdiffbeforeafterboth
22
3use crate as pallet_template;3use crate as pallet_template;
4use sp_core::H256;4use sp_core::H256;
5use frame_support::{parameter_types, weights::IdentityFee};5use frame_support::{parameter_types, traits::Everything, weights::IdentityFee};
6use sp_runtime::{6use sp_runtime::{
7 traits::{BlakeTwo256, IdentityLookup},7 traits::{BlakeTwo256, IdentityLookup},
8 testing::Header,8 testing::Header,
12use pallet_evm::AddressMapping;12use pallet_evm::AddressMapping;
13use crate::{EvmBackwardsAddressMapping, CrossAccountId};13use crate::{EvmBackwardsAddressMapping, CrossAccountId};
14use codec::{Encode, Decode};14use codec::{Encode, Decode};
15use scale_info::TypeInfo;
1516
16type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic<Test>;17type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic<Test>;
17type Block = frame_system::mocking::MockBlock<Test>;18type Block = frame_system::mocking::MockBlock<Test>;
35}36}
3637
37impl system::Config for Test {38impl system::Config for Test {
38 type BaseCallFilter = ();39 type BaseCallFilter = Everything;
39 type BlockWeights = ();40 type BlockWeights = ();
40 type BlockLength = ();41 type BlockLength = ();
41 type DbWeight = ();42 type DbWeight = ();
7980
80parameter_types! {81parameter_types! {
81 pub const TransactionByteFee: u64 = 1;82 pub const TransactionByteFee: u64 = 1;
83 pub const OperationalFeeMultiplier: u8 = 5;
82}84}
8385
84impl pallet_transaction_payment::Config for Test {86impl pallet_transaction_payment::Config for Test {
85 type OnChargeTransaction = CurrencyAdapter<pallet_balances::Pallet<Test>, ()>;87 type OnChargeTransaction = CurrencyAdapter<pallet_balances::Pallet<Test>, ()>;
86 type TransactionByteFee = TransactionByteFee;88 type TransactionByteFee = TransactionByteFee;
87 type WeightToFee = IdentityFee<u64>;89 type WeightToFee = IdentityFee<u64>;
88 type FeeMultiplierUpdate = ();90 type FeeMultiplierUpdate = ();
91 type OperationalFeeMultiplier = OperationalFeeMultiplier;
89}92}
9093
91parameter_types! {94parameter_types! {
118 }121 }
119}122}
120123
121#[derive(Encode, Decode, Clone, PartialEq, Eq, PartialOrd, Ord, Debug)]124#[derive(Encode, Decode, Clone, PartialEq, Eq, PartialOrd, Ord, Debug, TypeInfo)]
122pub struct TestCrossAccountId(u64, sp_core::H160);125pub struct TestCrossAccountId(u64, sp_core::H160);
123impl CrossAccountId<u64> for TestCrossAccountId {126impl CrossAccountId<u64> for TestCrossAccountId {
124 fn from_sub(sub: u64) -> Self {127 fn from_sub(sub: u64) -> Self {
modifiedpallets/scheduler/src/lib.rsdiffbeforeafterboth
796796
797 use frame_support::{797 use frame_support::{
798 Hashable, assert_err, assert_noop, assert_ok, ord_parameter_types, parameter_types,798 Hashable, assert_err, assert_noop, assert_ok, ord_parameter_types, parameter_types,
799 traits::{Contains, Filter, OnFinalize, OnInitialize},799 traits::{Contains, OnFinalize, OnInitialize},
800 weights::constants::RocksDbWeight,800 weights::constants::RocksDbWeight,
801 };801 };
802 use sp_core::H256;802 use sp_core::H256;
873 pub struct BaseFilter;873 pub struct BaseFilter;
874 impl Contains<Call> for BaseFilter {874 impl Contains<Call> for BaseFilter {
875 fn contains(call: &Call) -> bool {875 fn contains(call: &Call) -> bool {
876 !matches!(call, Call::Logger(logger::Call::log(_, _)))876 !matches!(call, Call::Logger(logger::Call::log { .. }))
877 }877 }
878 }878 }
879879