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
@@ -19,7 +19,7 @@ use crate::*;
use codec::Decode;
use frame_support::{
assert_ok, impl_outer_origin, parameter_types,
weights::{GetDispatchInfo, Weight},
weights::Weight,
};
use sp_core::{
H256,
@@ -61,6 +61,7 @@ impl frame_system::Trait for Test {
type Event = ();
type BlockHashCount = BlockHashCount;
type MaximumBlockWeight = MaximumBlockWeight;
type DbWeight = ();
type MaximumBlockLength = MaximumBlockLength;
type AvailableBlockRatio = AvailableBlockRatio;
type Version = ();
@@ -192,15 +193,6 @@ fn should_submit_unsigned_transaction_on_chain() {
});
}
#[test]
fn weights_work() {
// must have a default weight.
let default_call = <Call<Test>>::submit_price(10);
let info = default_call.get_dispatch_info();
// aka. `let info = <Call<Test> as GetDispatchInfo>::get_dispatch_info(&default_call);`
assert_eq!(info.weight, 10_000);
}
fn price_oracle_response(state: &mut testing::OffchainState) {
state.expect_request(0, testing::PendingRequest {
method: "GET".into(),