Companion for #6067 (#1110)

* Companion to #6067

* Fix tests?

* Use AvailableBlockLimit instead of hardcoding the value.

* Bump substrate.
This commit is contained in:
Tomasz Drwięga
2020-05-20 16:03:28 +02:00
committed by GitHub
parent a184320503
commit e08e5ff462
11 changed files with 154 additions and 141 deletions
+1
View File
@@ -646,6 +646,7 @@ mod tests {
type DbWeight = ();
type BlockExecutionWeight = ();
type ExtrinsicBaseWeight = ();
type MaximumExtrinsicWeight = MaximumBlockWeight;
type MaximumBlockLength = MaximumBlockLength;
type AvailableBlockRatio = AvailableBlockRatio;
type Version = ();
+1
View File
@@ -608,6 +608,7 @@ mod tests {
type DbWeight = ();
type BlockExecutionWeight = ();
type ExtrinsicBaseWeight = ();
type MaximumExtrinsicWeight = MaximumBlockWeight;
type MaximumBlockLength = MaximumBlockLength;
type AvailableBlockRatio = AvailableBlockRatio;
type Version = ();
+3 -1
View File
@@ -28,7 +28,7 @@ pub mod crowdfund;
pub mod impls;
use primitives::BlockNumber;
use sp_runtime::Perbill;
use sp_runtime::{traits::Saturating, Perbill};
use frame_support::{
parameter_types, traits::Currency,
weights::{Weight, constants::WEIGHT_PER_SECOND},
@@ -54,5 +54,7 @@ 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 const MaximumBlockLength: u32 = 5 * 1024 * 1024;
}
@@ -1624,6 +1624,7 @@ mod tests {
type DbWeight = ();
type BlockExecutionWeight = ();
type ExtrinsicBaseWeight = ();
type MaximumExtrinsicWeight = MaximumBlockWeight;
type MaximumBlockLength = MaximumBlockLength;
type AvailableBlockRatio = AvailableBlockRatio;
type Version = ();
+1
View File
@@ -738,6 +738,7 @@ mod tests {
type DbWeight = ();
type BlockExecutionWeight = ();
type ExtrinsicBaseWeight = ();
type MaximumExtrinsicWeight = MaximumBlockWeight;
type MaximumBlockLength = MaximumBlockLength;
type AvailableBlockRatio = AvailableBlockRatio;
type Version = ();
+1
View File
@@ -924,6 +924,7 @@ mod tests {
type DbWeight = ();
type BlockExecutionWeight = ();
type ExtrinsicBaseWeight = ();
type MaximumExtrinsicWeight = MaximumBlockWeight;
type MaximumBlockLength = MaximumBlockLength;
type AvailableBlockRatio = AvailableBlockRatio;
type Version = ();