mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 15:47:58 +00:00
Weights to u64 + Balances Weights (#5446)
Co-Authored-By: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
/// https://github.com/paritytech/substrate/blob/master/frame/example/src/lib.rs
|
||||
|
||||
use frame_support::{decl_module, decl_storage, decl_event, decl_error, dispatch};
|
||||
use frame_support::weights::{SimpleDispatchInfo, MINIMUM_WEIGHT};
|
||||
use frame_system::{self as system, ensure_signed};
|
||||
|
||||
#[cfg(test)]
|
||||
@@ -75,7 +76,7 @@ decl_module! {
|
||||
/// Just a dummy entry point.
|
||||
/// function that can be called by the external world as an extrinsics call
|
||||
/// takes a parameter of the type `AccountId`, stores it, and emits an event
|
||||
#[weight = frame_support::weights::SimpleDispatchInfo::default()]
|
||||
#[weight = SimpleDispatchInfo::FixedNormal(MINIMUM_WEIGHT)]
|
||||
pub fn do_something(origin, something: u32) -> dispatch::DispatchResult {
|
||||
// Check it was signed and get the signer. See also: ensure_root and ensure_none
|
||||
let who = ensure_signed(origin)?;
|
||||
@@ -91,7 +92,7 @@ decl_module! {
|
||||
|
||||
/// Another dummy entry point.
|
||||
/// takes no parameters, attempts to increment storage value, and possibly throws an error
|
||||
#[weight = frame_support::weights::SimpleDispatchInfo::default()]
|
||||
#[weight = SimpleDispatchInfo::FixedNormal(MINIMUM_WEIGHT)]
|
||||
pub fn cause_error(origin) -> dispatch::DispatchResult {
|
||||
// Check it was signed and get the signer. See also: ensure_root and ensure_none
|
||||
let _who = ensure_signed(origin)?;
|
||||
|
||||
@@ -36,6 +36,7 @@ impl system::Trait for Test {
|
||||
type Event = ();
|
||||
type BlockHashCount = BlockHashCount;
|
||||
type MaximumBlockWeight = MaximumBlockWeight;
|
||||
type DbWeight = ();
|
||||
type MaximumBlockLength = MaximumBlockLength;
|
||||
type AvailableBlockRatio = AvailableBlockRatio;
|
||||
type Version = ();
|
||||
|
||||
Reference in New Issue
Block a user