Fungibles trait and impl for Assets pallet (#8425)

* Fungibles trait and impl for Assets pallet

* Comment & whitespace

* Fixes

* Fix up CI/CD for the new labels.

* New labels.

* Fix labels

* Fix labels

* Whitespace

* Bump impl version.

* Fix accidental change

* Fixes

* Questionable fix.

* Better benchmark
This commit is contained in:
Gavin Wood
2021-03-23 14:10:36 +01:00
committed by GitHub
parent 956262a182
commit b5b0ef592e
5 changed files with 192 additions and 107 deletions
+3 -4
View File
@@ -79,7 +79,9 @@ pub fn compute_inflation<P: PerThing>(
falloff.lstrip();
let ln2 = {
let ln2 = P::from_rational(LN2.deconstruct().into(), Perquintill::ACCURACY.into());
/// `ln(2)` expressed in as perquintillionth.
const LN2: u64 = 0_693_147_180_559_945_309;
let ln2 = P::from_rational(LN2.into(), Perquintill::ACCURACY.into());
BigUint::from(ln2.deconstruct().into())
};
@@ -119,9 +121,6 @@ struct INPoSParam {
accuracy: BigUint,
}
/// `ln(2)` expressed in as perquintillionth.
const LN2: Perquintill = Perquintill::from_parts(0_693_147_180_559_945_309);
/// Compute `2^((x_ideal - x) / d)` using taylor serie.
///
/// x must be strictly more than x_ideal.