Remove wrongly introduced toNumber in fees (#599)
This commit is contained in:
parent
f82fbdf2e4
commit
a834850280
@ -37,7 +37,9 @@ class Proposal extends React.PureComponent<Props, State> {
|
||||
}
|
||||
|
||||
static getDerivedStateFromProps ({ deposit, query_democracy_minimumDeposit = new BN(0), onChange }: Props): State {
|
||||
const extraAmount = new BN(deposit.toNumber());
|
||||
const extraAmount = deposit instanceof Compact
|
||||
? deposit.toBn()
|
||||
: deposit;
|
||||
const isBelowMinimum = extraAmount.lt(query_democracy_minimumDeposit);
|
||||
|
||||
const update = {
|
||||
|
||||
@ -48,7 +48,7 @@ class Transfer extends React.PureComponent<Props, State> {
|
||||
extraFees = extraFees.add(fees.creationFee);
|
||||
}
|
||||
|
||||
const extraAmount = new BN(amount.toNumber());
|
||||
const extraAmount = amount instanceof Compact ? amount.toBn() : new BN(amount);
|
||||
const isCreation = derive_balances_votingBalance.votingBalance.isZero() && fees.creationFee.gtn(0);
|
||||
const isNoEffect = extraAmount.add(derive_balances_votingBalance.votingBalance).lte(fees.existentialDeposit);
|
||||
const extraWarn = isCreation || isNoEffect;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user