Update Block- and Extrinsic base weights (#5202)

* Remove constants:: module

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Update block+extrinsic weights

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* fmt

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Sanity check full block price

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Spellcheck on

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
This commit is contained in:
Oliver Tale-Yazdi
2022-03-29 14:11:17 +02:00
committed by GitHub
parent 0e3f36224a
commit cb8cf97cd2
16 changed files with 469 additions and 217 deletions
+5 -6
View File
@@ -104,13 +104,12 @@ mod tests {
use runtime_common::MAXIMUM_BLOCK_WEIGHT;
#[test]
// This function tests that the fee for `MAXIMUM_BLOCK_WEIGHT` of weight is correct
// Test that the fee for `MAXIMUM_BLOCK_WEIGHT` of weight has sane bounds.
fn full_block_fee_is_correct() {
// A full block should cost 16 DOLLARS
println!("Base: {}", ExtrinsicBaseWeight::get());
let x = WeightToFee::calc(&MAXIMUM_BLOCK_WEIGHT);
let y = 16 * DOLLARS;
assert!(x.max(y) - x.min(y) < MILLICENTS);
// A full block should cost between 10 and 100 DOLLARS.
let full_block = WeightToFee::calc(&MAXIMUM_BLOCK_WEIGHT);
assert!(full_block >= 10 * DOLLARS);
assert!(full_block <= 100 * DOLLARS);
}
#[test]