Use decimal comparison in faucet token manager
This commit is contained in:
parent
0ae83b0657
commit
d6d6d3fee5
@ -54,9 +54,7 @@ export class TokenManager {
|
||||
const thresholdAmount = this.refillThreshold(tickerSymbol);
|
||||
const threshold = Decimal.fromAtomics(thresholdAmount.amount, meta.fractionalDigits);
|
||||
|
||||
// TODO: perform < operation on Decimal type directly
|
||||
// https://github.com/iov-one/iov-core/issues/1375
|
||||
return balance.toFloatApproximation() < threshold.toFloatApproximation();
|
||||
return balance.isLessThan(threshold);
|
||||
}
|
||||
|
||||
private getTokenMeta(tickerSymbol: string): BankTokenMeta {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user