Fix a bug when we didn't call isNaN function and assumed it's a property

This commit is contained in:
Leonid Logvinov 2019-01-15 13:45:22 +01:00
parent 2cca2d70d7
commit a3cb722469
No known key found for this signature in database
GPG Key ID: 0DD294BFDE8C95D4
2 changed files with 2 additions and 2 deletions

View File

@ -69,7 +69,7 @@ export class AbiDecoder {
} }
if (param.type === SolidityTypes.Address) { if (param.type === SolidityTypes.Address) {
const baseHex = 16; 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) { } else if (param.type === SolidityTypes.Uint256 || param.type === SolidityTypes.Uint) {
value = new BigNumber(value); value = new BigNumber(value);
} else if (param.type === SolidityTypes.Uint8) { } else if (param.type === SolidityTypes.Uint8) {

View File

@ -14,7 +14,7 @@ function sanityCheckBigNumberRange(
throw new Error(`Tried to assign value of ${value}, which exceeds max value of ${maxValue}`); throw new Error(`Tried to assign value of ${value}, which exceeds max value of ${maxValue}`);
} else if (value.isLessThan(minValue)) { } else if (value.isLessThan(minValue)) {
throw new Error(`Tried to assign value of ${value}, which exceeds min value of ${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`); throw new Error(`Tried to assign NaN value`);
} }
} }