3.7.3 (w/ Polkadot 27 upgrade blocks) (#3139)

This commit is contained in:
Jaco Greeff
2021-02-02 17:29:43 +01:00
committed by GitHub
parent 0352a30b6b
commit 724574afe7
17 changed files with 257 additions and 241 deletions
+4 -4
View File
@@ -7,7 +7,7 @@ import type { UIntBitLength } from './types';
import BN from 'bn.js';
import { assert, BN_ZERO, bnToBn, bnToHex, bnToU8a, formatBalance, formatNumber, hexToBn, isHex, isString, isU8a, u8aToBn } from '@polkadot/util';
import { assert, BN_BILLION, BN_HUNDRED, BN_MILLION, BN_ZERO, bnToBn, bnToHex, bnToU8a, formatBalance, formatNumber, hexToBn, isHex, isString, isU8a, u8aToBn } from '@polkadot/util';
export const DEFAULT_UINT_BITS = 64;
@@ -18,9 +18,9 @@ const MUL_P = new BN(1_00_00);
const FORMATTERS: [string, BN][] = [
['Perquintill', new BN(1_000_000_000_000)],
['Perbill', new BN(1_000_000_000)],
['Permill', new BN(1_000_000)],
['Percent', new BN(100)]
['Perbill', BN_BILLION],
['Permill', BN_MILLION],
['Percent', BN_HUNDRED]
];
function toPercentage (value: BN, divisor: BN): string {