Enable fixed point u128 (#6214)

* Add fixed u128.

* remove move

* Change sat_from_integer impl.

* checked_pow is always positive

* Revert.

* rename fixed file

* Rename to FixedI

* rename fixed file

* Add newline.

* Use Multiplier in impls.

* Renames negate() to saturating_negate().

* Uncomment test.

* Add Signed to macro.

* Add some tests for Saturating trait.
This commit is contained in:
Marcio Diaz
2020-06-06 13:04:39 +02:00
committed by GitHub
parent 0761a8e0c3
commit 7c051caa42
11 changed files with 424 additions and 342 deletions
+2 -2
View File
@@ -37,7 +37,7 @@ macro_rules! decl_tests {
($test:ty, $ext_builder:ty, $existential_deposit:expr) => {
use crate::*;
use sp_runtime::{FixedPointNumber, Fixed128, traits::{SignedExtension, BadOrigin}};
use sp_runtime::{FixedPointNumber, FixedI128, traits::{SignedExtension, BadOrigin}};
use frame_support::{
assert_noop, assert_ok, assert_err,
traits::{
@@ -162,7 +162,7 @@ macro_rules! decl_tests {
.monied(true)
.build()
.execute_with(|| {
pallet_transaction_payment::NextFeeMultiplier::put(Fixed128::saturating_from_integer(1));
pallet_transaction_payment::NextFeeMultiplier::put(FixedI128::saturating_from_integer(1));
Balances::set_lock(ID_1, &1, 10, WithdrawReason::Reserve.into());
assert_noop!(
<Balances as Currency<_>>::transfer(&1, &2, 1, AllowDeath),