mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 13:57:58 +00:00
staking: Flexible generation of reward curve and associated tweaks (#8327)
* Initial abstraction * Alter rest of APIs * Fixes * Some extra getters in Gilt pallet. * Refactor Gilt to avoid u128 conversions * Simplify and improve pow in per_things * Add scalar division to per_things * Renaming from_fraction -> from_float, drop _approximation * Fixes * Fixes * Fixes * Fixes * Make stuff build * Fixes * Fixes * Fixes * Fixes * Update .gitignore Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> * Update frame/gilt/src/lib.rs Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> * Update frame/gilt/src/mock.rs Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> * Fixes * Fixes * Fixes Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com> Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
This commit is contained in:
@@ -130,11 +130,8 @@
|
||||
#[cfg(feature = "std")]
|
||||
use serde::{Serialize, Deserialize};
|
||||
use codec::{Encode, Decode};
|
||||
use sp_runtime::{
|
||||
RuntimeDebug,
|
||||
traits::SignedExtension,
|
||||
generic::{CheckedExtrinsic, UncheckedExtrinsic},
|
||||
};
|
||||
use sp_runtime::{RuntimeDebug, traits::SignedExtension};
|
||||
use sp_runtime::generic::{CheckedExtrinsic, UncheckedExtrinsic};
|
||||
use crate::dispatch::{DispatchErrorWithPostInfo, DispatchResultWithPostInfo, DispatchError};
|
||||
use sp_runtime::traits::SaturatedConversion;
|
||||
use sp_arithmetic::{Perbill, traits::{BaseArithmetic, Saturating, Unsigned}};
|
||||
@@ -964,13 +961,13 @@ mod tests {
|
||||
smallvec![
|
||||
WeightToFeeCoefficient {
|
||||
coeff_integer: 0,
|
||||
coeff_frac: Perbill::from_fraction(0.5),
|
||||
coeff_frac: Perbill::from_float(0.5),
|
||||
negative: false,
|
||||
degree: 3
|
||||
},
|
||||
WeightToFeeCoefficient {
|
||||
coeff_integer: 2,
|
||||
coeff_frac: Perbill::from_rational_approximation(1u32, 3u32),
|
||||
coeff_frac: Perbill::from_rational(1u32, 3u32),
|
||||
negative: false,
|
||||
degree: 2
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user