Handle bignumber conversions
The kredits module always returns raw data from the contract. For uint values these are bignumbers. To handle those in the ember app we need to convert them to string or to number.
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
import computed from 'ember-computed';
|
||||
import EmberObject from 'ember-object';
|
||||
import bignumber from 'kredits-web/utils/cps/bignumber';
|
||||
|
||||
export default EmberObject.extend({
|
||||
// Contract
|
||||
id: null,
|
||||
id: bignumber('idRaw', 'toString'),
|
||||
// TODO: Should we rename it to account like in the contract?
|
||||
address: null,
|
||||
balance: 0,
|
||||
balance: bignumber('balanceRaw', 'toNumber'),
|
||||
isCore: false,
|
||||
ipfsHash: null,
|
||||
|
||||
|
||||
Reference in New Issue
Block a user