mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 22:47:56 +00:00
Introduce sensible weight constants (#12868)
* Introduce sensible weight constants * cargo fmt * Remove unused import * Add missing import * ".git/.scripts/bench-bot.sh" pallet dev pallet_lottery Co-authored-by: command-bot <>
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
//! Contains the core benchmarking logic.
|
||||
|
||||
use codec::DecodeAll;
|
||||
use frame_support::weights::constants::WEIGHT_PER_NANOS;
|
||||
use frame_support::weights::constants::WEIGHT_REF_TIME_PER_NANOS;
|
||||
use frame_system::ConsumedWeight;
|
||||
use sc_block_builder::{BlockBuilderApi, BlockBuilderProvider};
|
||||
use sc_cli::{Error, Result};
|
||||
@@ -148,7 +148,7 @@ where
|
||||
|
||||
let weight = ConsumedWeight::decode_all(&mut raw_weight)?;
|
||||
// Should be divisible, but still use floats in case we ever change that.
|
||||
Ok((weight.total().ref_time() as f64 / WEIGHT_PER_NANOS.ref_time() as f64).floor()
|
||||
Ok((weight.total().ref_time() as f64 / WEIGHT_REF_TIME_PER_NANOS as f64).floor()
|
||||
as NanoSeconds)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user