aboutsummaryrefslogtreecommitdiffstats
path: root/packages/utils/src/abi_utils.ts
diff options
context:
space:
mode:
authorAlex Browne <stephenalexbrowne@gmail.com>2018-07-27 05:32:52 +0800
committerAlex Browne <stephenalexbrowne@gmail.com>2018-08-09 05:27:30 +0800
commit6a6739ebbec291b61226c047fde7b3d0bb4a7250 (patch)
tree4f46c2cd8c14b972497134a7e7342d0a28c0b407 /packages/utils/src/abi_utils.ts
parent6a5965d73bb542634631d7af76c150795d899744 (diff)
downloaddexon-sol-tools-6a6739ebbec291b61226c047fde7b3d0bb4a7250.tar
dexon-sol-tools-6a6739ebbec291b61226c047fde7b3d0bb4a7250.tar.gz
dexon-sol-tools-6a6739ebbec291b61226c047fde7b3d0bb4a7250.tar.bz2
dexon-sol-tools-6a6739ebbec291b61226c047fde7b3d0bb4a7250.tar.lz
dexon-sol-tools-6a6739ebbec291b61226c047fde7b3d0bb4a7250.tar.xz
dexon-sol-tools-6a6739ebbec291b61226c047fde7b3d0bb4a7250.tar.zst
dexon-sol-tools-6a6739ebbec291b61226c047fde7b3d0bb4a7250.zip
Apply prettier
Diffstat (limited to 'packages/utils/src/abi_utils.ts')
-rw-r--r--packages/utils/src/abi_utils.ts14
1 files changed, 10 insertions, 4 deletions
diff --git a/packages/utils/src/abi_utils.ts b/packages/utils/src/abi_utils.ts
index 16aa72afd..874e0b2da 100644
--- a/packages/utils/src/abi_utils.ts
+++ b/packages/utils/src/abi_utils.ts
@@ -21,10 +21,12 @@ function parseEthersParams(params: DataItem[]): { names: EthersParamName[]; type
if (param.components != null) {
let suffix = '';
const arrayBracket = param.type.indexOf('[');
- if (arrayBracket >= 0) { suffix = param.type.substring(arrayBracket); }
+ if (arrayBracket >= 0) {
+ suffix = param.type.substring(arrayBracket);
+ }
const result = parseEthersParams(param.components);
- names.push({ name: (param.name || null), names: result.names });
+ names.push({ name: param.name || null, names: result.names });
types.push('tuple(' + result.types.join(',') + ')' + suffix);
} else {
names.push(param.name || null);
@@ -74,7 +76,9 @@ function isAbiDataEqual(name: EthersParamName, type: string, x: any, y: any): bo
// one individually.
const types = splitTupleTypes(type);
if (types.length !== name.names.length) {
- throw new Error(`Internal error: parameter types/names length mismatch (${types.length} != ${name.names.length})`);
+ throw new Error(
+ `Internal error: parameter types/names length mismatch (${types.length} != ${name.names.length})`,
+ );
}
for (let i = 0; i < types.length; i++) {
// For tuples, name is an object with a names property that is an
@@ -89,7 +93,9 @@ function isAbiDataEqual(name: EthersParamName, type: string, x: any, y: any): bo
// ]
// }
//
- const nestedName = _.isString(name.names[i]) ? name.names[i] as string : (name.names[i] as EthersNestedParamName).name as string;
+ const nestedName = _.isString(name.names[i])
+ ? (name.names[i] as string)
+ : ((name.names[i] as EthersNestedParamName).name as string);
if (!isAbiDataEqual(name.names[i], types[i], x[nestedName], y[nestedName])) {
return false;
}