aboutsummaryrefslogtreecommitdiffstats
path: root/packages/utils/src/abi_encoder/abstract_data_types/types
diff options
context:
space:
mode:
authorGreg Hysen <greg.hysen@gmail.com>2018-11-28 07:28:26 +0800
committerGreg Hysen <greg.hysen@gmail.com>2018-11-29 08:38:11 +0800
commitf479212410b238a7673983148f403b3a220083af (patch)
tree4d3ebe1ee98ec0a03b8eb99275878f5cc2062123 /packages/utils/src/abi_encoder/abstract_data_types/types
parentffb8b0a619be3b8fb30a6acc99f590a6b40d49e1 (diff)
downloaddexon-sol-tools-f479212410b238a7673983148f403b3a220083af.tar
dexon-sol-tools-f479212410b238a7673983148f403b3a220083af.tar.gz
dexon-sol-tools-f479212410b238a7673983148f403b3a220083af.tar.bz2
dexon-sol-tools-f479212410b238a7673983148f403b3a220083af.tar.lz
dexon-sol-tools-f479212410b238a7673983148f403b3a220083af.tar.xz
dexon-sol-tools-f479212410b238a7673983148f403b3a220083af.tar.zst
dexon-sol-tools-f479212410b238a7673983148f403b3a220083af.zip
Style cleanup. Improved wording of some error messages.
Diffstat (limited to 'packages/utils/src/abi_encoder/abstract_data_types/types')
-rw-r--r--packages/utils/src/abi_encoder/abstract_data_types/types/pointer.ts4
-rw-r--r--packages/utils/src/abi_encoder/abstract_data_types/types/set.ts4
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[] = [];