Weights to u64 + Balances Weights (#5446)

Co-Authored-By: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
This commit is contained in:
Shawn Tabrizi
2020-04-16 10:43:18 +02:00
committed by GitHub
parent 1c7525fd4b
commit 980b635c8d
82 changed files with 636 additions and 428 deletions
+7 -9
View File
@@ -24,7 +24,7 @@ use sp_core::{
NeverNativeValue, map, traits::Externalities, storage::{well_known_keys, Storage},
};
use sp_runtime::{
ApplyExtrinsicResult, Fixed64,
ApplyExtrinsicResult, Fixed128,
traits::{Hash as HashT, Convert, BlakeTwo256},
transaction_validity::InvalidTransaction,
};
@@ -51,7 +51,7 @@ use self::common::{*, sign};
pub const BLOATY_CODE: &[u8] = node_runtime::WASM_BINARY_BLOATY;
/// Default transfer fee
fn transfer_fee<E: Encode>(extrinsic: &E, fee_multiplier: Fixed64) -> Balance {
fn transfer_fee<E: Encode>(extrinsic: &E, fee_multiplier: Fixed128) -> Balance {
let length_fee = TransactionByteFee::get() * (extrinsic.encode().len() as Balance);
let weight = default_transfer_call().get_dispatch_info().weight;
@@ -338,7 +338,7 @@ fn full_native_block_import_works() {
EventRecord {
phase: Phase::ApplyExtrinsic(0),
event: Event::frame_system(frame_system::RawEvent::ExtrinsicSuccess(
DispatchInfo { weight: 10000, class: DispatchClass::Mandatory, pays_fee: true }
DispatchInfo { weight: 10_000_000, class: DispatchClass::Mandatory, pays_fee: true }
)),
topics: vec![],
},
@@ -359,7 +359,7 @@ fn full_native_block_import_works() {
EventRecord {
phase: Phase::ApplyExtrinsic(1),
event: Event::frame_system(frame_system::RawEvent::ExtrinsicSuccess(
DispatchInfo { weight: 1000000, class: DispatchClass::Normal, pays_fee: true }
DispatchInfo { weight: 200_000_000, class: DispatchClass::Normal, pays_fee: true }
)),
topics: vec![],
},
@@ -391,7 +391,7 @@ fn full_native_block_import_works() {
EventRecord {
phase: Phase::ApplyExtrinsic(0),
event: Event::frame_system(frame_system::RawEvent::ExtrinsicSuccess(
DispatchInfo { weight: 10000, class: DispatchClass::Mandatory, pays_fee: true }
DispatchInfo { weight: 10_000_000, class: DispatchClass::Mandatory, pays_fee: true }
)),
topics: vec![],
},
@@ -414,7 +414,7 @@ fn full_native_block_import_works() {
EventRecord {
phase: Phase::ApplyExtrinsic(1),
event: Event::frame_system(frame_system::RawEvent::ExtrinsicSuccess(
DispatchInfo { weight: 1000000, class: DispatchClass::Normal, pays_fee: true }
DispatchInfo { weight: 200_000_000, class: DispatchClass::Normal, pays_fee: true }
)),
topics: vec![],
},
@@ -437,7 +437,7 @@ fn full_native_block_import_works() {
EventRecord {
phase: Phase::ApplyExtrinsic(2),
event: Event::frame_system(frame_system::RawEvent::ExtrinsicSuccess(
DispatchInfo { weight: 1000000, class: DispatchClass::Normal, pays_fee: true }
DispatchInfo { weight: 200_000_000, class: DispatchClass::Normal, pays_fee: true }
)),
topics: vec![],
},
@@ -817,5 +817,3 @@ fn should_import_block_with_test_client() {
client.import(BlockOrigin::Own, block).unwrap();
}