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

two UNITS in cli-utils.js #61

@hsinhoyeh

Description

@hsinhoyeh

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions