diff options
author | Greg Hysen <greg.hysen@gmail.com> | 2018-11-28 07:28:26 +0800 |
---|---|---|
committer | Greg Hysen <greg.hysen@gmail.com> | 2018-11-29 08:38:11 +0800 |
commit | f479212410b238a7673983148f403b3a220083af (patch) | |
tree | 4d3ebe1ee98ec0a03b8eb99275878f5cc2062123 /packages/utils/src/abi_encoder/abstract_data_types | |
parent | ffb8b0a619be3b8fb30a6acc99f590a6b40d49e1 (diff) | |
download | dexon-0x-contracts-f479212410b238a7673983148f403b3a220083af.tar dexon-0x-contracts-f479212410b238a7673983148f403b3a220083af.tar.gz dexon-0x-contracts-f479212410b238a7673983148f403b3a220083af.tar.bz2 dexon-0x-contracts-f479212410b238a7673983148f403b3a220083af.tar.lz dexon-0x-contracts-f479212410b238a7673983148f403b3a220083af.tar.xz dexon-0x-contracts-f479212410b238a7673983148f403b3a220083af.tar.zst dexon-0x-contracts-f479212410b238a7673983148f403b3a220083af.zip |
Style cleanup. Improved wording of some error messages.
Diffstat (limited to 'packages/utils/src/abi_encoder/abstract_data_types')
-rw-r--r-- | packages/utils/src/abi_encoder/abstract_data_types/types/pointer.ts | 4 | ||||
-rw-r--r-- | packages/utils/src/abi_encoder/abstract_data_types/types/set.ts | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/packages/utils/src/abi_encoder/abstract_data_types/types/pointer.ts b/packages/utils/src/abi_encoder/abstract_data_types/types/pointer.ts index dc9de8a3d..8e597636b 100644 --- a/packages/utils/src/abi_encoder/abstract_data_types/types/pointer.ts +++ b/packages/utils/src/abi_encoder/abstract_data_types/types/pointer.ts @@ -1,4 +1,3 @@ -/* tslint:disable prefer-function-over-method */ import { DataItem } from 'ethereum-types'; import * as ethUtil from 'ethereumjs-util'; import * as _ from 'lodash'; @@ -44,7 +43,10 @@ export abstract class Pointer extends DataType { return value; } + // Disable prefer-function-over-method for inherited abstract method. + /* tslint:disable prefer-function-over-method */ public isStatic(): boolean { return true; } + /* tslint:enable prefer-function-over-method */ } diff --git a/packages/utils/src/abi_encoder/abstract_data_types/types/set.ts b/packages/utils/src/abi_encoder/abstract_data_types/types/set.ts index 637abfb7d..aeea7919f 100644 --- a/packages/utils/src/abi_encoder/abstract_data_types/types/set.ts +++ b/packages/utils/src/abi_encoder/abstract_data_types/types/set.ts @@ -50,7 +50,7 @@ export abstract class Set extends DataType { public generateValue(calldata: RawCalldata, rules: DecodingRules): any[] | object { let members = this._members; // Case 1: This is an array of undefined length, which means that `this._members` was not - // populated in the constructor. So, construct the set of members it now. + // populated in the constructor. So we must construct the set of members now. if (this._isArray && _.isUndefined(this._arrayLength)) { const arrayLengthBuf = calldata.popWord(); const arrayLengthHex = ethUtil.bufferToHex(arrayLengthBuf); @@ -176,7 +176,7 @@ export abstract class Set extends DataType { private _createMembersWithKeys(dataItem: DataItem): [DataType[], MemberIndexByName] { // Sanity check if (_.isUndefined(dataItem.components)) { - throw new Error(`Expected components`); + throw new Error(`Tried to create a set using key/value pairs, but no components were defined by the input DataItem '${dataItem.name}'.`); } // Create one member for each component of `dataItem` const members: DataType[] = []; |