Companion for #6629 (weight params refactor) (#1420)

* Change branch.

* Update runtime.

* Revert "Change branch."

This reverts commit 841c59f3398136c27cc235a29d7d459e8a4c8ce0.

* Update substrate.

* Fix tests.

* Fix compilation.

* Fix frame system imports.

* Fix usages of system

* Fix stuff.

* Fix compilation.

* Fixes.

* Fix block_weight usage.

* Bump substrate.
This commit is contained in:
Tomasz Drwięga
2020-12-08 13:55:57 +01:00
committed by GitHub
parent 48746afd6a
commit f28333aedb
18 changed files with 298 additions and 332 deletions
+9 -17
View File
@@ -17,17 +17,14 @@
//! Mocks for all the traits.
use sp_io::TestExternalities;
use sp_core::{H256};
use sp_runtime::{
Perbill,
traits::{
BlakeTwo256, IdentityLookup,
},
use sp_core::H256;
use sp_runtime::traits::{
BlakeTwo256, IdentityLookup,
};
use primitives::v1::{AuthorityDiscoveryId, BlockNumber, Header};
use frame_support::{
impl_outer_origin, impl_outer_dispatch, impl_outer_event, parameter_types,
weights::Weight, traits::Randomness as RandomnessT,
traits::Randomness as RandomnessT,
};
use crate::inclusion;
use crate as parachains;
@@ -65,13 +62,15 @@ impl RandomnessT<H256> for TestRandomness {
parameter_types! {
pub const BlockHashCount: u32 = 250;
pub const MaximumBlockWeight: Weight = 4 * 1024 * 1024;
pub const MaximumBlockLength: u32 = 4 * 1024 * 1024;
pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75);
pub BlockWeights: frame_system::limits::BlockWeights =
frame_system::limits::BlockWeights::simple_max(4 * 1024 * 1024);
}
impl frame_system::Config for Test {
type BaseCallFilter = ();
type BlockWeights = BlockWeights;
type BlockLength = ();
type DbWeight = ();
type Origin = Origin;
type Call = Call;
type Index = u64;
@@ -83,13 +82,6 @@ impl frame_system::Config for Test {
type Header = Header;
type Event = TestEvent;
type BlockHashCount = BlockHashCount;
type MaximumBlockWeight = MaximumBlockWeight;
type DbWeight = ();
type BlockExecutionWeight = ();
type ExtrinsicBaseWeight = ();
type MaximumExtrinsicWeight = MaximumBlockWeight;
type MaximumBlockLength = MaximumBlockLength;
type AvailableBlockRatio = AvailableBlockRatio;
type Version = ();
type PalletInfo = ();
type AccountData = pallet_balances::AccountData<u128>;