Fix kredits balance handling
Kredits are stored on the Token contract as uint256 / bignumbers with 18 decimal points. Just like Ether and required by the ERC20 standard. So we need to work with bignumbers and format a bignumber value here.
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
import { computed } from '@ember/object';
|
||||
import EmberObject from '@ember/object';
|
||||
import bignumber from 'kredits-web/utils/cps/bignumber';
|
||||
import kreditsValue from 'kredits-web/utils/cps/kredits';
|
||||
|
||||
export default EmberObject.extend({
|
||||
// Contract
|
||||
id: bignumber('idRaw', 'toString'),
|
||||
account: null,
|
||||
balance: bignumber('balanceRaw', 'toNumber'),
|
||||
balance: kreditsValue('balanceRaw'),
|
||||
isCore: false,
|
||||
ipfsHash: null,
|
||||
|
||||
|
||||
Reference in New Issue
Block a user