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