From 29cc0795b4446c2a1dce0ca758435c857599e460 Mon Sep 17 00:00:00 2001 From: ricmoo Date: Wed, 5 Apr 2017 16:33:37 -0400 Subject: [PATCH] Fixed cross-package isBigNumber. --- utils/bignumber.js | 6 +++--- utils/package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/utils/bignumber.js b/utils/bignumber.js index e46820871..311e661db 100644 --- a/utils/bignumber.js +++ b/utils/bignumber.js @@ -28,7 +28,7 @@ function BigNumber(value) { } else if (BN.isBN(value)) { //value = value - } else if (value instanceof BigNumber) { + } else if (isBigNumber(value)) { value = value._bn; } else if (convert.isArrayish(value)) { @@ -124,11 +124,11 @@ defineProperty(BigNumber.prototype, 'toHexString', function() { function isBigNumber(value) { - return (value instanceof BigNumber); + return (value._bn && value._bn.mod); } function bigNumberify(value) { - if (value instanceof BigNumber) { return value; } + if (isBigNumber(value)) { return value; } return new BigNumber(value); } diff --git a/utils/package.json b/utils/package.json index 47e80e010..196527db0 100644 --- a/utils/package.json +++ b/utils/package.json @@ -1,6 +1,6 @@ { "name": "ethers-utils", - "version": "2.0.1", + "version": "2.0.2", "description": "Utilities for the Ethers Ethereum library.", "bugs": { "url": "http://github.com/ethers-io/ethers.js/issues",