aboutsummaryrefslogtreecommitdiffstats
path: root/packages/base-contract
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2018-09-21 18:05:13 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2018-09-21 18:05:13 +0800
commit393f9e5a293511ede662907861cf72e4f8add098 (patch)
tree6a4ba0832bcbcc48942790fcc6e22780475b36b4 /packages/base-contract
parent79cf6969f9fb4eedb48d790449663780d1516a43 (diff)
downloaddexon-sol-tools-393f9e5a293511ede662907861cf72e4f8add098.tar
dexon-sol-tools-393f9e5a293511ede662907861cf72e4f8add098.tar.gz
dexon-sol-tools-393f9e5a293511ede662907861cf72e4f8add098.tar.bz2
dexon-sol-tools-393f9e5a293511ede662907861cf72e4f8add098.tar.lz
dexon-sol-tools-393f9e5a293511ede662907861cf72e4f8add098.tar.xz
dexon-sol-tools-393f9e5a293511ede662907861cf72e4f8add098.tar.zst
dexon-sol-tools-393f9e5a293511ede662907861cf72e4f8add098.zip
Fix the way we detect BN's
Diffstat (limited to 'packages/base-contract')
-rw-r--r--packages/base-contract/CHANGELOG.json8
-rw-r--r--packages/base-contract/src/index.ts2
2 files changed, 9 insertions, 1 deletions
diff --git a/packages/base-contract/CHANGELOG.json b/packages/base-contract/CHANGELOG.json
index 89580ca90..296a4a06c 100644
--- a/packages/base-contract/CHANGELOG.json
+++ b/packages/base-contract/CHANGELOG.json
@@ -1,5 +1,13 @@
[
{
+ "version": "3.0.0",
+ "changes": [
+ {
+ "note": "Change the way we detect BN to work with the newest ethers.js"
+ }
+ ]
+ },
+ {
"timestamp": 1536142250,
"version": "2.0.2",
"changes": [
diff --git a/packages/base-contract/src/index.ts b/packages/base-contract/src/index.ts
index 35c830a46..90e576c24 100644
--- a/packages/base-contract/src/index.ts
+++ b/packages/base-contract/src/index.ts
@@ -61,7 +61,7 @@ export class BaseContract {
}
}
protected static _bnToBigNumber(_type: string, value: any): any {
- return _.isObject(value) && value._bn ? new BigNumber(value.toString()) : value;
+ return _.isObject(value) && value._hex ? new BigNumber(value.toString()) : value;
}
protected static async _applyDefaultsToTxDataAsync<T extends Partial<TxData | TxDataPayable>>(
txData: T,