bitpay / bitcore-wallet

A command line interface Multisig HD Wallet, based on `bitcore-wallet-service`.
MIT License
99 stars 108 forks source link

two UNITS in cli-utils.js #61

Open hsinhoyeh opened 7 years ago

hsinhoyeh commented 7 years ago

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