Skip to content
This repository has been archived by the owner on Apr 3, 2019. It is now read-only.

two UNITS in cli-utils.js #61

Open
hsinhoyeh opened this issue Sep 11, 2017 · 1 comment
Open

two UNITS in cli-utils.js #61

hsinhoyeh opened this issue Sep 11, 2017 · 1 comment

Comments

@hsinhoyeh
Copy link

hi there,

I saw there are two Utils.UNITS in cli-utils.js (see [2] and [3]) which acutally cause troubles when determining rate at [1].

var rate = Utils.UNITS[unit];

which requires a number not a structure as you specified here:

Utils.UNITS = {
  btc: {
    name: 'btc',
    toSatoshis: 100000000,
    maxDecimals: 8,
    minDecimals: 8,
  },
  bit: {
    name: 'bit',
    toSatoshis: 100,
    maxDecimals: 2,
    minDecimals: 2,
  },
};

I don't know which one you are going to keep, but I am sure that not the both.

[1] https://github.com/bitpay/bitcore-wallet/blob/master/bin/cli-utils.js#L241
[2] https://github.com/bitpay/bitcore-wallet/blob/master/bin/cli-utils.js#L260
[3] https://github.com/bitpay/bitcore-wallet/blob/master/bin/cli-utils.js#L222

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@hsinhoyeh and others