let -> const in callAsync

This commit is contained in:
Greg Hysen
2018-12-23 21:02:55 -08:00
parent 86caa4a0bb
commit 33f3405226
2 changed files with 7 additions and 7 deletions

View File

@@ -16,6 +16,6 @@ async callAsync(
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
const abiEncoder = self._lookupAbiEncoder('{{this.functionSignature}}');
let resultArray = abiEncoder.decodeReturnValuesAsArrayOrNull(rawCallResult);
const resultArray = abiEncoder.decodeReturnValuesAsArrayOrNull(rawCallResult);
return resultArray{{#singleReturnValue}}[0]{{/singleReturnValue}};
},

View File

@@ -29,6 +29,12 @@ export class BaseContract {
): any {
return _.map(values, (value: any, i: number) => formatABIDataItem(abis[i], value, formatter));
}
protected static _lowercaseAddress(type: string, value: string): string {
return type === 'address' ? value.toLowerCase() : value;
}
protected static _bigNumberToString(_type: string, value: any): any {
return _.isObject(value) && value.isBigNumber ? value.toString() : value;
}
protected static _lookupConstructorAbi(abi: ContractAbi): ConstructorAbi {
const constructorAbiIfExists = _.find(
abi,
@@ -98,12 +104,6 @@ export class BaseContract {
}
return rawEncoded;
}
protected static _lowercaseAddress(type: string, value: string): string {
return type === 'address' ? value.toLowerCase() : value;
}
protected static _bigNumberToString(_type: string, value: any): any {
return _.isObject(value) && value.isBigNumber ? value.toString() : value;
}
protected _lookupAbiEncoder(functionSignature: string): AbiEncoder.Method {
const abiEncoder = this._abiEncoderByFunctionSignature[functionSignature];
if (_.isUndefined(abiEncoder)) {