aboutsummaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorGreg Hysen <greg.hysen@gmail.com>2018-12-24 13:02:55 +0800
committerGreg Hysen <greg.hysen@gmail.com>2019-01-15 02:49:44 +0800
commit33f340522699322b0a0d76ffb5c4ebef3351c53a (patch)
tree93d790b91190a0eb3bf9380a3238423c2333b0f8 /packages
parent86caa4a0bb82e3ba7d362cca9b75565bf8944952 (diff)
downloaddexon-sol-tools-33f340522699322b0a0d76ffb5c4ebef3351c53a.tar
dexon-sol-tools-33f340522699322b0a0d76ffb5c4ebef3351c53a.tar.gz
dexon-sol-tools-33f340522699322b0a0d76ffb5c4ebef3351c53a.tar.bz2
dexon-sol-tools-33f340522699322b0a0d76ffb5c4ebef3351c53a.tar.lz
dexon-sol-tools-33f340522699322b0a0d76ffb5c4ebef3351c53a.tar.xz
dexon-sol-tools-33f340522699322b0a0d76ffb5c4ebef3351c53a.tar.zst
dexon-sol-tools-33f340522699322b0a0d76ffb5c4ebef3351c53a.zip
`let` -> `const` in callAsync
Diffstat (limited to 'packages')
-rw-r--r--packages/abi-gen-templates/partials/callAsync.handlebars2
-rw-r--r--packages/base-contract/src/index.ts12
2 files changed, 7 insertions, 7 deletions
diff --git a/packages/abi-gen-templates/partials/callAsync.handlebars b/packages/abi-gen-templates/partials/callAsync.handlebars
index e978f577d..37b50307c 100644
--- a/packages/abi-gen-templates/partials/callAsync.handlebars
+++ b/packages/abi-gen-templates/partials/callAsync.handlebars
@@ -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}};
},
diff --git a/packages/base-contract/src/index.ts b/packages/base-contract/src/index.ts
index 30546725c..a08c3381d 100644
--- a/packages/base-contract/src/index.ts
+++ b/packages/base-contract/src/index.ts
@@ -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)) {