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
+6 -4
View File
@@ -23,8 +23,9 @@ use codec::Decode;
use sp_std::prelude::*;
use sp_runtime::{traits::{BlakeTwo256, IdentityLookup}, testing::{H256, Header}};
use frame_support::{
dispatch::DispatchResult, decl_module, decl_storage, impl_outer_origin,
assert_ok, assert_err, ensure
dispatch::DispatchResult,
weights::{SimpleDispatchInfo, MINIMUM_WEIGHT},
decl_module, decl_storage, impl_outer_origin, assert_ok, assert_err, ensure
};
use frame_system::{RawOrigin, ensure_signed, ensure_none};
@@ -36,14 +37,14 @@ decl_storage! {
decl_module! {
pub struct Module<T: Trait> for enum Call where origin: T::Origin {
#[weight = frame_support::weights::SimpleDispatchInfo::default()]
#[weight = SimpleDispatchInfo::FixedNormal(MINIMUM_WEIGHT)]
fn set_value(origin, n: u32) -> DispatchResult {
let _sender = ensure_signed(origin)?;
Value::put(n);
Ok(())
}
#[weight = frame_support::weights::SimpleDispatchInfo::default()]
#[weight = SimpleDispatchInfo::FixedNormal(MINIMUM_WEIGHT)]
fn dummy(origin, _n: u32) -> DispatchResult {
let _sender = ensure_none(origin)?;
Ok(())
@@ -78,6 +79,7 @@ impl frame_system::Trait for Test {
type Event = ();
type BlockHashCount = ();
type MaximumBlockWeight = ();
type DbWeight = ();
type MaximumBlockLength = ();
type AvailableBlockRatio = ();
type Version = ();