Merge ifs

This commit is contained in:
Leonid Logvinov 2018-02-27 10:43:42 -08:00
parent 4f1e6296ca
commit a0390956a9
No known key found for this signature in database
GPG Key ID: 0DD294BFDE8C95D4

View File

@ -36,14 +36,12 @@ export const utils = {
tsType: 'number|BigNumber', tsType: 'number|BigNumber',
}); });
} }
if (backend === ContractsBackend.Ethers) { if (backend === ContractsBackend.Ethers && paramKind === ParamKind.Output) {
if (paramKind === ParamKind.Output) { // ethers-contracts automatically converts small BigNumbers to numbers
// ethers-contracts automatically converts small BigNumbers to numbers solTypeRegexToTsType.unshift({
solTypeRegexToTsType.unshift({ regex: '^u?int(8|16|32|48)?$',
regex: '^u?int(8|16|32|48)?$', tsType: 'number',
tsType: 'number', });
});
}
} }
for (const regexAndTxType of solTypeRegexToTsType) { for (const regexAndTxType of solTypeRegexToTsType) {
const { regex, tsType } = regexAndTxType; const { regex, tsType } = regexAndTxType;