New genesis (#327)

* Update Substrate & Polkadot

* Update chainspecs

* Update again to fix test
This commit is contained in:
Bastian Köcher
2021-02-15 11:20:36 +01:00
committed by GitHub
parent ba0bdc84a5
commit 5f5df0485a
13 changed files with 677 additions and 633 deletions
+19 -26
View File
@@ -866,7 +866,7 @@ mod tests {
use frame_support::{
assert_ok,
dispatch::UnfilteredDispatchable,
impl_outer_event, impl_outer_origin, parameter_types,
parameter_types,
traits::{OnFinalize, OnInitialize},
};
use frame_system::{InitKind, RawOrigin};
@@ -877,26 +877,22 @@ mod tests {
use sp_version::RuntimeVersion;
use std::cell::RefCell;
impl_outer_origin! {
pub enum Origin for Test where system = frame_system {}
}
use crate as parachain_system;
mod parachain_system {
pub use crate::Event;
}
type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic<Test>;
type Block = frame_system::mocking::MockBlock<Test>;
impl_outer_event! {
pub enum TestEvent for Test {
frame_system<T>,
parachain_system,
frame_support::construct_runtime!(
pub enum Test where
Block = Block,
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic,
{
System: frame_system::{Module, Call, Config, Storage, Event<T>},
ParachainSystem: parachain_system::{Module, Call, Storage, Event},
}
}
);
// For testing the pallet, we construct most of a mock runtime. This means
// first constructing a configuration type (`Test`) which `impl`s each of the
// configuration traits of modules we want to use.
#[derive(Clone, Eq, PartialEq)]
pub struct Test;
parameter_types! {
pub const BlockHashCount: u64 = 250;
pub Version: RuntimeVersion = RuntimeVersion {
@@ -912,7 +908,7 @@ mod tests {
}
impl frame_system::Config for Test {
type Origin = Origin;
type Call = ();
type Call = Call;
type Index = u64;
type BlockNumber = u64;
type Hash = H256;
@@ -920,12 +916,12 @@ mod tests {
type AccountId = u64;
type Lookup = IdentityLookup<Self::AccountId>;
type Header = Header;
type Event = TestEvent;
type Event = Event;
type BlockHashCount = BlockHashCount;
type BlockLength = ();
type BlockWeights = ();
type Version = Version;
type PalletInfo = ();
type PalletInfo = PalletInfo;
type AccountData = ();
type OnNewAccount = ();
type OnKilledAccount = ();
@@ -935,16 +931,13 @@ mod tests {
type SS58Prefix = ();
}
impl Config for Test {
type Event = TestEvent;
type Event = Event;
type OnValidationData = ();
type SelfParaId = ParachainId;
type DownwardMessageHandlers = SaveIntoThreadLocal;
type HrmpMessageHandlers = SaveIntoThreadLocal;
}
type ParachainSystem = Module<Test>;
type System = frame_system::Module<Test>;
pub struct SaveIntoThreadLocal;
std::thread_local! {
@@ -1241,7 +1234,7 @@ mod tests {
let events = System::events();
assert_eq!(
events[0].event,
TestEvent::parachain_system(Event::ValidationFunctionStored(1123))
Event::parachain_system(crate::Event::ValidationFunctionStored(1123))
);
},
)
@@ -1252,7 +1245,7 @@ mod tests {
let events = System::events();
assert_eq!(
events[0].event,
TestEvent::parachain_system(Event::ValidationFunctionApplied(1234))
Event::parachain_system(crate::Event::ValidationFunctionApplied(1234))
);
},
);