Skip to content

Conversation

@bassjobsen
Copy link
Contributor

@a1300
Copy link
Contributor

a1300 commented Sep 17, 2018

@bassjobsen

Review:

1

please use string interpolation instead of + adding strings
Example:

- getApi().get('/api/v2/accounts/' + address, null, function (err, result) {
+ getApi().get(`/api/v2/accounts/${address}`, null, function (err, result) {

2

I get an error if I call getBalance without an address. You don't need to necessary fix this. It depends upon how similar functions handle this:

bin/asch-cli getbalance

Error:

/home/a1300/test/asch-cli/plugins/api.js:50
    console.log(err || result.account.xas);
                                      ^

TypeError: Cannot read property 'xas' of undefined

3

If I call bin/asch-cli getbalance AHMCKebuL2nRYDgszf9J2KjVZzAw95WUyB and the address wasn't initated before (it has no entry in the Account table) then it throws an error:

Response:

{
  "success": true,
  "unconfirmedAccount": null,
  "latestBlock": {
    "height": -1
  },
  "version": {
    "version": "1.5.0",
    "build": "DEFAULT_BUILD_TIME",
    "net": "testnet"
  }
}

Error:

/home/a1300/test/asch-cli/plugins/api.js:51
    console.log(err || result.account.xas);
                                      ^

TypeError: Cannot read property 'xas' of undefined

Please fix the small problems. Thanks 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants