mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 22:07:58 +00:00
Per-things trait. (#4904)
* Give perthigns the trait it always deserved.
* Make staking and phragmen work with the new generic per_thing
* Make everything work together 🔨
* a bit of cleanup
* Clean usage
* Bump.
* Fix name
* fix grumbles
* hopefully fix the ui test
* Some grumbles
* revamp traits again
* Better naming again.
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
use crate::{GasSpent, Module, Trait, BalanceOf, NegativeImbalanceOf};
|
||||
use sp_std::convert::TryFrom;
|
||||
use sp_runtime::traits::{
|
||||
CheckedMul, Zero, SaturatedConversion, SimpleArithmetic, UniqueSaturatedInto,
|
||||
CheckedMul, Zero, SaturatedConversion, AtLeast32Bit, UniqueSaturatedInto,
|
||||
};
|
||||
use frame_support::{
|
||||
traits::{Currency, ExistenceRequirement, Imbalance, OnUnbalanced, WithdrawReason}, StorageValue,
|
||||
@@ -248,7 +248,7 @@ pub fn refund_unused_gas<T: Trait>(
|
||||
/// A little handy utility for converting a value in balance units into approximate value in gas units
|
||||
/// at the given gas price.
|
||||
pub fn approx_gas_for_balance<Balance>(gas_price: Balance, balance: Balance) -> Gas
|
||||
where Balance: SimpleArithmetic
|
||||
where Balance: AtLeast32Bit
|
||||
{
|
||||
(balance / gas_price).saturated_into::<Gas>()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user