Skip to content
Snippets Groups Projects
Unverified Commit 266768bb authored by wangjj9219's avatar wangjj9219 Committed by GitHub
Browse files

use mock structs (#376)

parent 1e74be90
No related branches found
No related tags found
No related merge requests found
......@@ -77,8 +77,8 @@ impl Config for Runtime {
type WeightInfo = ();
}
pub type Block = sp_runtime::generic::Block<Header, UncheckedExtrinsic>;
pub type UncheckedExtrinsic = sp_runtime::generic::UncheckedExtrinsic<u32, Call, u32, ()>;
type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic<Runtime>;
type Block = frame_system::mocking::MockBlock<Runtime>;
construct_runtime!(
pub enum Runtime where
......
......@@ -153,8 +153,8 @@ impl Config for Runtime {
type WeightInfo = ();
}
pub type Block = sp_runtime::generic::Block<Header, UncheckedExtrinsic>;
pub type UncheckedExtrinsic = sp_runtime::generic::UncheckedExtrinsic<u32, u64, u64, ()>;
type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic<Runtime>;
type Block = frame_system::mocking::MockBlock<Runtime>;
frame_support::construct_runtime!(
pub enum Runtime where
......@@ -162,7 +162,7 @@ frame_support::construct_runtime!(
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic
{
System: frame_system::{Module, Call, Event<T>},
System: frame_system::{Module, Call, Config, Event<T>},
Authority: authority::{Module, Call, Origin<T>, Event<T>},
Scheduler: pallet_scheduler::{Module, Call, Storage, Event<T>},
}
......
......@@ -3,7 +3,7 @@
#![cfg(test)]
use super::*;
use frame_support::{construct_runtime, parameter_types, traits::GenesisBuild};
use frame_support::{construct_runtime, parameter_types};
use orml_traits::parameter_type_with_key;
use sp_core::H256;
use sp_runtime::{
......@@ -98,8 +98,8 @@ impl Config for Runtime {
pub type NativeCurrency = NativeCurrencyOf<Runtime>;
pub type AdaptedBasicCurrency = BasicCurrencyAdapter<Runtime, PalletBalances, i64, u64>;
pub type Block = sp_runtime::generic::Block<Header, UncheckedExtrinsic>;
pub type UncheckedExtrinsic = sp_runtime::generic::UncheckedExtrinsic<u32, Call, u32, ()>;
type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic<Runtime>;
type Block = frame_system::mocking::MockBlock<Runtime>;
construct_runtime!(
pub enum Runtime where
......@@ -111,7 +111,6 @@ construct_runtime!(
Currencies: currencies::{Module, Call, Event<T>},
Tokens: orml_tokens::{Module, Storage, Event<T>, Config<T>},
PalletBalances: pallet_balances::{Module, Call, Storage, Config<T>, Event<T>},
}
);
......
......@@ -52,8 +52,8 @@ impl Config for Runtime {
type WeightInfo = ();
}
pub type Block = sp_runtime::generic::Block<Header, UncheckedExtrinsic>;
pub type UncheckedExtrinsic = sp_runtime::generic::UncheckedExtrinsic<u32, Call, u32, ()>;
type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic<Runtime>;
type Block = frame_system::mocking::MockBlock<Runtime>;
construct_runtime!(
pub enum Runtime where
......
......@@ -49,8 +49,8 @@ impl Config for Runtime {
type TokenData = ();
}
pub type Block = sp_runtime::generic::Block<Header, UncheckedExtrinsic>;
pub type UncheckedExtrinsic = sp_runtime::generic::UncheckedExtrinsic<u32, Call, u32, ()>;
type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic<Runtime>;
type Block = frame_system::mocking::MockBlock<Runtime>;
construct_runtime!(
pub enum Runtime where
......@@ -60,7 +60,6 @@ construct_runtime!(
{
System: frame_system::{Module, Call, Storage, Config, Event<T>},
NonFungibleTokenModule: nft::{Module, Storage, Config<T>},
}
);
......
......@@ -2,7 +2,7 @@
use super::*;
use frame_support::{construct_runtime, parameter_types, traits::GenesisBuild};
use frame_support::{construct_runtime, parameter_types};
use sp_core::H256;
use sp_runtime::{
testing::Header,
......@@ -83,8 +83,8 @@ impl Config for Test {
type WeightInfo = ();
}
pub type Block = sp_runtime::generic::Block<Header, UncheckedExtrinsic>;
pub type UncheckedExtrinsic = sp_runtime::generic::UncheckedExtrinsic<u32, Call, u32, ()>;
type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic<Test>;
type Block = frame_system::mocking::MockBlock<Test>;
construct_runtime!(
pub enum Test where
......@@ -94,7 +94,6 @@ construct_runtime!(
{
System: frame_system::{Module, Call, Storage, Config, Event<T>},
ModuleOracle: oracle::{Module, Storage, Call, Config<T>, Event<T>},
}
);
......
......@@ -109,8 +109,8 @@ impl Config for Runtime {
type WeightInfo = ();
}
pub type Block = sp_runtime::generic::Block<Header, UncheckedExtrinsic>;
pub type UncheckedExtrinsic = sp_runtime::generic::UncheckedExtrinsic<u32, Call, u32, ()>;
type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic<Runtime>;
type Block = frame_system::mocking::MockBlock<Runtime>;
construct_runtime!(
pub enum Runtime where
......@@ -120,7 +120,6 @@ construct_runtime!(
{
System: frame_system::{Module, Call, Storage, Config, Event<T>},
RewardsModule: rewards::{Module, Storage, Call},
}
);
......
......@@ -5,7 +5,7 @@
use super::*;
use frame_support::{
construct_runtime, parameter_types,
traits::{ChangeMembers, Contains, ContainsLengthBound, GenesisBuild, SaturatingCurrencyToVote},
traits::{ChangeMembers, Contains, ContainsLengthBound, SaturatingCurrencyToVote},
};
use orml_traits::parameter_type_with_key;
use sp_core::H256;
......@@ -217,8 +217,8 @@ impl Config for Runtime {
}
pub type TreasuryCurrencyAdapter = <Runtime as pallet_treasury::Config>::Currency;
pub type Block = sp_runtime::generic::Block<Header, UncheckedExtrinsic>;
pub type UncheckedExtrinsic = sp_runtime::generic::UncheckedExtrinsic<u32, Call, u32, ()>;
type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic<Runtime>;
type Block = frame_system::mocking::MockBlock<Runtime>;
construct_runtime!(
pub enum Runtime where
......
......@@ -3,10 +3,7 @@
#![cfg(test)]
use super::*;
use frame_support::{
construct_runtime, parameter_types,
traits::{EnsureOrigin, GenesisBuild},
};
use frame_support::{construct_runtime, parameter_types, traits::EnsureOrigin};
use frame_system::RawOrigin;
use sp_core::H256;
use sp_runtime::{testing::Header, traits::IdentityLookup};
......@@ -86,8 +83,8 @@ impl Config for Runtime {
type WeightInfo = ();
}
pub type Block = sp_runtime::generic::Block<Header, UncheckedExtrinsic>;
pub type UncheckedExtrinsic = sp_runtime::generic::UncheckedExtrinsic<u32, Call, u32, ()>;
type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic<Runtime>;
type Block = frame_system::mocking::MockBlock<Runtime>;
construct_runtime!(
pub enum Runtime where
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment