aboutsummaryrefslogtreecommitdiffstats
path: root/packages/utils
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2019-01-15 20:45:22 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2019-01-15 23:25:26 +0800
commita3cb722469e90a676ac00bcd7a9934dbb6e52468 (patch)
treebdd97c2d9479e6739cb8d811da86d4af09cb8f76 /packages/utils
parent2cca2d70d742713747e6c8777b5b4af27115ae97 (diff)
downloaddexon-sol-tools-a3cb722469e90a676ac00bcd7a9934dbb6e52468.tar
dexon-sol-tools-a3cb722469e90a676ac00bcd7a9934dbb6e52468.tar.gz
dexon-sol-tools-a3cb722469e90a676ac00bcd7a9934dbb6e52468.tar.bz2
dexon-sol-tools-a3cb722469e90a676ac00bcd7a9934dbb6e52468.tar.lz
dexon-sol-tools-a3cb722469e90a676ac00bcd7a9934dbb6e52468.tar.xz
dexon-sol-tools-a3cb722469e90a676ac00bcd7a9934dbb6e52468.tar.zst
dexon-sol-tools-a3cb722469e90a676ac00bcd7a9934dbb6e52468.zip
Fix a bug when we didn't call isNaN function and assumed it's a property
Diffstat (limited to 'packages/utils')
-rw-r--r--packages/utils/src/abi_decoder.ts2
-rw-r--r--packages/utils/src/abi_encoder/utils/math.ts2
2 files changed, 2 insertions, 2 deletions
diff --git a/packages/utils/src/abi_decoder.ts b/packages/utils/src/abi_decoder.ts
index 28b6418d8..2da46db35 100644
--- a/packages/utils/src/abi_decoder.ts
+++ b/packages/utils/src/abi_decoder.ts
@@ -69,7 +69,7 @@ export class AbiDecoder {
}
if (param.type === SolidityTypes.Address) {
const baseHex = 16;
- value = addressUtils.padZeros(new BigNumber((value as string).toLowerCase()).toString(baseHex));
+ value = addressUtils.padZeros(new BigNumber(value).toString(baseHex));
} else if (param.type === SolidityTypes.Uint256 || param.type === SolidityTypes.Uint) {
value = new BigNumber(value);
} else if (param.type === SolidityTypes.Uint8) {
diff --git a/packages/utils/src/abi_encoder/utils/math.ts b/packages/utils/src/abi_encoder/utils/math.ts
index dd45ea05c..a2a79e2a8 100644
--- a/packages/utils/src/abi_encoder/utils/math.ts
+++ b/packages/utils/src/abi_encoder/utils/math.ts
@@ -14,7 +14,7 @@ function sanityCheckBigNumberRange(
throw new Error(`Tried to assign value of ${value}, which exceeds max value of ${maxValue}`);
} else if (value.isLessThan(minValue)) {
throw new Error(`Tried to assign value of ${value}, which exceeds min value of ${minValue}`);
- } else if (value.isNaN) {
+ } else if (value.isNaN()) {
throw new Error(`Tried to assign NaN value`);
}
}