diff options
author | Greg Hysen <greg.hysen@gmail.com> | 2018-11-29 05:22:18 +0800 |
---|---|---|
committer | Greg Hysen <greg.hysen@gmail.com> | 2018-11-29 08:38:11 +0800 |
commit | a172ab158e2eaca8256ef881c3f2d4098987ec8a (patch) | |
tree | 4187301296e4f7fb37cb6907c5b857a3aa86fa1b /packages/utils/src/abi_encoder/evm_data_types/array.ts | |
parent | 5c13353fb2512411c0f2c8cba9395235188f5df8 (diff) | |
download | dexon-0x-contracts-a172ab158e2eaca8256ef881c3f2d4098987ec8a.tar dexon-0x-contracts-a172ab158e2eaca8256ef881c3f2d4098987ec8a.tar.gz dexon-0x-contracts-a172ab158e2eaca8256ef881c3f2d4098987ec8a.tar.bz2 dexon-0x-contracts-a172ab158e2eaca8256ef881c3f2d4098987ec8a.tar.lz dexon-0x-contracts-a172ab158e2eaca8256ef881c3f2d4098987ec8a.tar.xz dexon-0x-contracts-a172ab158e2eaca8256ef881c3f2d4098987ec8a.tar.zst dexon-0x-contracts-a172ab158e2eaca8256ef881c3f2d4098987ec8a.zip |
Explicit imports for EVM Data Types
Diffstat (limited to 'packages/utils/src/abi_encoder/evm_data_types/array.ts')
-rw-r--r-- | packages/utils/src/abi_encoder/evm_data_types/array.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/packages/utils/src/abi_encoder/evm_data_types/array.ts b/packages/utils/src/abi_encoder/evm_data_types/array.ts index 272cc4132..1736bcef0 100644 --- a/packages/utils/src/abi_encoder/evm_data_types/array.ts +++ b/packages/utils/src/abi_encoder/evm_data_types/array.ts @@ -4,17 +4,17 @@ import * as _ from 'lodash'; import { AbstractDataTypes, DataTypeFactory } from '../abstract_data_types'; import { constants } from '../utils/constants'; -export class Array extends AbstractDataTypes.Set { +export class ArrayDataType extends AbstractDataTypes.Set { private static readonly _MATCHER = RegExp('^(.+)\\[([0-9]*)\\]$'); private readonly _arraySignature: string; private readonly _elementType: string; public static matchType(type: string): boolean { - return Array._MATCHER.test(type); + return ArrayDataType._MATCHER.test(type); } private static _decodeElementTypeAndLengthFromType(type: string): [string, undefined | number] { - const matches = Array._MATCHER.exec(type); + const matches = ArrayDataType._MATCHER.exec(type); if (_.isNull(matches) || matches.length !== 3) { throw new Error(`Could not parse array: ${type}`); } else if (_.isUndefined(matches[1])) { @@ -30,7 +30,7 @@ export class Array extends AbstractDataTypes.Set { public constructor(dataItem: DataItem, dataTypeFactory: DataTypeFactory) { // Construct parent const isArray = true; - const [arrayElementType, arrayLength] = Array._decodeElementTypeAndLengthFromType(dataItem.type); + const [arrayElementType, arrayLength] = ArrayDataType._decodeElementTypeAndLengthFromType(dataItem.type); super(dataItem, dataTypeFactory, isArray, arrayLength, arrayElementType); // Set array properties this._elementType = arrayElementType; |