Update Substrate & Polkadot (#141)

This commit is contained in:
Bastian Köcher
2020-07-09 15:28:45 +02:00
committed by GitHub
parent fa0a3c1f42
commit e40bef8641
10 changed files with 520 additions and 418 deletions
+13 -12
View File
@@ -41,16 +41,16 @@ use parachain::primitives::RelayChainBlockNumber;
use sp_core::storage::well_known_keys;
use sp_inherents::{InherentData, InherentIdentifier, ProvideInherent};
use sp_std::vec::Vec;
use system::ensure_none;
use frame_system::ensure_none;
/// A ValidationFunction is a compiled WASM blob which, on execution, validates parachain blocks.
pub type ValidationFunction = Vec<u8>;
type System<T> = system::Module<T>;
type System<T> = frame_system::Module<T>;
/// The pallet's configuration trait.
pub trait Trait: system::Trait {
pub trait Trait: frame_system::Trait {
/// The overarching event type.
type Event: From<Event> + Into<<Self as system::Trait>::Event>;
type Event: From<Event> + Into<<Self as frame_system::Trait>::Event>;
/// Something which can be notified when the validation function params are set.
///
@@ -246,10 +246,10 @@ mod tests {
Perbill,
};
use sp_version::RuntimeVersion;
use system::{InitKind, RawOrigin};
use frame_system::{InitKind, RawOrigin};
impl_outer_origin! {
pub enum Origin for Test {}
pub enum Origin for Test where system = frame_system {}
}
mod parachain_upgrade {
@@ -258,7 +258,7 @@ mod tests {
impl_outer_event! {
pub enum TestEvent for Test {
system<T>,
frame_system<T>,
parachain_upgrade,
}
}
@@ -283,7 +283,7 @@ mod tests {
transaction_version: 1,
};
}
impl system::Trait for Test {
impl frame_system::Trait for Test {
type Origin = Origin;
type Call = ();
type Index = u64;
@@ -308,6 +308,7 @@ mod tests {
type BlockExecutionWeight = ();
type ExtrinsicBaseWeight = ();
type BaseCallFilter = ();
type SystemWeightInfo = ();
}
impl Trait for Test {
type Event = TestEvent;
@@ -319,7 +320,7 @@ mod tests {
// This function basically just builds a genesis storage key/value store according to
// our desired mockup.
fn new_test_ext() -> sp_io::TestExternalities {
system::GenesisConfig::default()
frame_system::GenesisConfig::default()
.build_storage::<Test>()
.unwrap()
.into()
@@ -356,7 +357,7 @@ mod tests {
}
struct BlockTest {
n: <Test as system::Trait>::BlockNumber,
n: <Test as frame_system::Trait>::BlockNumber,
within_block: Box<dyn Fn()>,
after_block: Option<Box<dyn Fn()>>,
}
@@ -384,7 +385,7 @@ mod tests {
self
}
fn add<F>(self, n: <Test as system::Trait>::BlockNumber, within_block: F) -> Self
fn add<F>(self, n: <Test as frame_system::Trait>::BlockNumber, within_block: F) -> Self
where
F: 'static + Fn(),
{
@@ -397,7 +398,7 @@ mod tests {
fn add_with_post_test<F1, F2>(
self,
n: <Test as system::Trait>::BlockNumber,
n: <Test as frame_system::Trait>::BlockNumber,
within_block: F1,
after_block: F2,
) -> Self