diff options
author | Greg Hysen <greg.hysen@gmail.com> | 2018-12-24 12:50:02 +0800 |
---|---|---|
committer | Greg Hysen <greg.hysen@gmail.com> | 2019-01-15 02:49:44 +0800 |
commit | 86caa4a0bb82e3ba7d362cca9b75565bf8944952 (patch) | |
tree | 1cddd589130d6844dcb6824d1b4bcf588a8719b5 /packages/utils/src/abi_encoder/abstract_data_types | |
parent | 6d832deb62cdef38c5fa69169986ef00dbc6e1eb (diff) | |
download | dexon-0x-contracts-86caa4a0bb82e3ba7d362cca9b75565bf8944952.tar dexon-0x-contracts-86caa4a0bb82e3ba7d362cca9b75565bf8944952.tar.gz dexon-0x-contracts-86caa4a0bb82e3ba7d362cca9b75565bf8944952.tar.bz2 dexon-0x-contracts-86caa4a0bb82e3ba7d362cca9b75565bf8944952.tar.lz dexon-0x-contracts-86caa4a0bb82e3ba7d362cca9b75565bf8944952.tar.xz dexon-0x-contracts-86caa4a0bb82e3ba7d362cca9b75565bf8944952.tar.zst dexon-0x-contracts-86caa4a0bb82e3ba7d362cca9b75565bf8944952.zip |
Ran prettier and linter
Diffstat (limited to 'packages/utils/src/abi_encoder/abstract_data_types')
3 files changed, 6 insertions, 5 deletions
diff --git a/packages/utils/src/abi_encoder/abstract_data_types/data_type.ts b/packages/utils/src/abi_encoder/abstract_data_types/data_type.ts index dc897d810..d9e854f51 100644 --- a/packages/utils/src/abi_encoder/abstract_data_types/data_type.ts +++ b/packages/utils/src/abi_encoder/abstract_data_types/data_type.ts @@ -58,9 +58,13 @@ export abstract class DataType { } public getSignature(detailed?: boolean): string { - if (_.isEmpty(this._dataItem.name) || !detailed) return this.getSignatureType(); + if (_.isEmpty(this._dataItem.name) || !detailed) { + return this.getSignatureType(); + } const name = this.getDataItem().name; - const shortName = name.indexOf('.') > 0 ? name.substr(name.lastIndexOf('.') + 1) : name; + const lastIndexOfScopeDelimiter = name.lastIndexOf('.'); + const isScopedName = !_.isUndefined(lastIndexOfScopeDelimiter) && lastIndexOfScopeDelimiter > 0; + const shortName = isScopedName ? name.substr((lastIndexOfScopeDelimiter as number) + 1) : name; const detailedSignature = `${shortName} ${this.getSignatureType()}`; return detailedSignature; } diff --git a/packages/utils/src/abi_encoder/abstract_data_types/types/blob.ts b/packages/utils/src/abi_encoder/abstract_data_types/types/blob.ts index 4252b782c..a091e55b9 100644 --- a/packages/utils/src/abi_encoder/abstract_data_types/types/blob.ts +++ b/packages/utils/src/abi_encoder/abstract_data_types/types/blob.ts @@ -9,8 +9,6 @@ import { DecodingRules } from '../../utils/rules'; import { DataType } from '../data_type'; import { DataTypeFactory } from '../interfaces'; -import * as ethUtil from 'ethereumjs-util'; - export abstract class AbstractBlobDataType extends DataType { protected _sizeKnownAtCompileTime: boolean; 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 28d11c4b5..e4be96235 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 @@ -13,7 +13,6 @@ import { DataType } from '../data_type'; import { DataTypeFactory, MemberIndexByName } from '../interfaces'; import { AbstractPointerDataType } from './pointer'; -import { logUtils } from '../../../log_utils'; export abstract class AbstractSetDataType extends DataType { protected readonly _arrayLength: number | undefined; |