mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-15 18:31:05 +00:00
Implement FixedPoint trait. (#5877)
* Implement Fixed trait. * Fix tests * Fix tests * Fix tests 2 * Address review comment regarding from_i129. * Remove precision by using log10() as suggested in review. * Add small comments. * Use checked versions + panic for ops::*. * Remove repeated test. * Uncomment test. * Remove casts. * Add more comments. * Add tests. * Panic on saturating_div_int * More tests. * More docs. * Saturating renames. * Fix to_bound doc. * Move some impl to trait. * Add range * Add macro pre. * More round() tests. * Delete confusion. * More impl to trait * Add doc for fixedpoint op. * Remove trailing spaces. * Suggested docs changes. * More tests and comments for roundings. * Some quickcheck tests. * Add missing panic, more test/comments. * Nits. * Rename. * Remove primitives-types import. * Apply review suggestions * Fix long lines and add some fuzz. * fix long line * Update fuzzer * Bump impl * fix warnings Co-authored-by: Gavin Wood <gavin@parity.io> Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
This commit is contained in:
@@ -37,7 +37,7 @@ macro_rules! decl_tests {
|
||||
($test:ty, $ext_builder:ty, $existential_deposit:expr) => {
|
||||
|
||||
use crate::*;
|
||||
use sp_runtime::{Fixed128, traits::{SignedExtension, BadOrigin}};
|
||||
use sp_runtime::{FixedPointNumber, Fixed128, traits::{SignedExtension, BadOrigin}};
|
||||
use frame_support::{
|
||||
assert_noop, assert_ok, assert_err,
|
||||
traits::{
|
||||
@@ -154,7 +154,7 @@ macro_rules! decl_tests {
|
||||
.monied(true)
|
||||
.build()
|
||||
.execute_with(|| {
|
||||
pallet_transaction_payment::NextFeeMultiplier::put(Fixed128::from_natural(1));
|
||||
pallet_transaction_payment::NextFeeMultiplier::put(Fixed128::saturating_from_integer(1));
|
||||
Balances::set_lock(ID_1, &1, 10, WithdrawReason::Reserve.into());
|
||||
assert_noop!(
|
||||
<Balances as Currency<_>>::transfer(&1, &2, 1, AllowDeath),
|
||||
|
||||
Reference in New Issue
Block a user