seal: Refactor ext_gas_price (#6478)

* seal: Refactor ext_gas_price

* Remove seals dependency on pallet_transaction_payment
* Add weight as an argument to ext_gas_price

* Fixed documentation nits from review

* Do not use unchecked math even in test code
This commit is contained in:
Alexander Theißen
2020-06-24 12:52:49 +02:00
committed by GitHub
parent f36b78570f
commit a3a42f599a
9 changed files with 51 additions and 51 deletions
+3 -9
View File
@@ -30,7 +30,7 @@ use frame_support::{
assert_ok, assert_err_ignore_postinfo, impl_outer_dispatch, impl_outer_event,
impl_outer_origin, parameter_types, StorageMap, StorageValue,
traits::{Currency, Get},
weights::{Weight, PostDispatchInfo, IdentityFee},
weights::{Weight, PostDispatchInfo},
};
use std::cell::RefCell;
use frame_system::{self as system, EventRecord, Phase};
@@ -169,17 +169,10 @@ impl Convert<Weight, BalanceOf<Self>> for Test {
}
}
impl pallet_transaction_payment::Trait for Test {
type Currency = Balances;
type OnTransactionPayment = ();
type TransactionByteFee = TransactionByteFee;
type WeightToFee = IdentityFee<BalanceOf<Self>>;
type FeeMultiplierUpdate = ();
}
impl Trait for Test {
type Time = Timestamp;
type Randomness = Randomness;
type Currency = Balances;
type Call = Call;
type DetermineContractAddress = DummyContractAddressFor;
type Event = MetaEvent;
@@ -193,6 +186,7 @@ impl Trait for Test {
type SurchargeReward = SurchargeReward;
type MaxDepth = MaxDepth;
type MaxValueSize = MaxValueSize;
type WeightPrice = Self;
}
type Balances = pallet_balances::Module<Test>;