companion for substrate/pull/6132 (#1159)

* companion for https://github.com/paritytech/substrate/pull/6132

* Fix more tests

* upsub

* Bump

* Update runtime/common/src/lib.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* remove cleanup

* Update runtime/westend/src/lib.rs

* Apply suggestions from code review

* Fix build

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
Kian Paimani
2020-05-27 19:13:56 +02:00
committed by GitHub
parent d5f343a73f
commit 357ed9f3ec
10 changed files with 610 additions and 447 deletions
+1 -1
View File
@@ -684,7 +684,7 @@ mod tests {
}
parameter_types!{
pub const Prefix: &'static [u8] = b"Pay RUSTs to the TEST account:";
pub Prefix: &'static [u8] = b"Pay RUSTs to the TEST account:";
}
impl Trait for Test {
+5 -3
View File
@@ -38,7 +38,7 @@ use frame_support::{
parameter_types, traits::{Currency, Filter},
weights::{Weight, constants::WEIGHT_PER_SECOND},
};
use static_assertions::const_assert;
pub use frame_support::weights::constants::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight};
#[cfg(feature = "std")]
@@ -56,15 +56,17 @@ use sp_runtime::traits::Dispatchable;
pub type NegativeImbalance<T> = <balances::Module<T> as Currency<<T as system::Trait>::AccountId>>::NegativeImbalance;
const AVERAGE_ON_INITIALIZE_WEIGHT: Perbill = Perbill::from_percent(10);
parameter_types! {
pub const BlockHashCount: BlockNumber = 2400;
pub const MaximumBlockWeight: Weight = 2 * WEIGHT_PER_SECOND;
pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75);
pub const MaximumExtrinsicWeight: Weight = AvailableBlockRatio::get()
.saturating_sub(Perbill::from_percent(10)) * MaximumBlockWeight::get();
pub MaximumExtrinsicWeight: Weight = AvailableBlockRatio::get()
.saturating_sub(AVERAGE_ON_INITIALIZE_WEIGHT) * MaximumBlockWeight::get();
pub const MaximumBlockLength: u32 = 5 * 1024 * 1024;
}
const_assert!(AvailableBlockRatio::get().deconstruct() >= AVERAGE_ON_INITIALIZE_WEIGHT.deconstruct());
/// Apply a given filter to transactions.
pub struct TransactionCallFilter<T: Filter<Call>, Call>(PhantomData<(T, Call)>);
+1 -1
View File
@@ -1811,7 +1811,7 @@ mod tests {
}
parameter_types! {
pub const OffencesWeightSoftLimit: Weight = Perbill::from_percent(60) * MaximumBlockWeight::get();
pub OffencesWeightSoftLimit: Weight = Perbill::from_percent(60) * MaximumBlockWeight::get();
}
impl offences::Trait for Test {