diff options
author | Hsuan Lee <hsuan@cobinhood.com> | 2019-01-19 18:42:04 +0800 |
---|---|---|
committer | Hsuan Lee <hsuan@cobinhood.com> | 2019-01-19 18:42:04 +0800 |
commit | 7ae38906926dc09bc10670c361af0d2bf0050426 (patch) | |
tree | 5fb10ae366b987db09e4ddb4bc3ba0f75404ad08 /packages/utils/src/abi_encoder/evm_data_types/tuple.ts | |
parent | b5fd3c72a08aaa6957917d74c333387a16edf66b (diff) | |
download | dexon-sol-tools-7ae38906926dc09bc10670c361af0d2bf0050426.tar dexon-sol-tools-7ae38906926dc09bc10670c361af0d2bf0050426.tar.gz dexon-sol-tools-7ae38906926dc09bc10670c361af0d2bf0050426.tar.bz2 dexon-sol-tools-7ae38906926dc09bc10670c361af0d2bf0050426.tar.lz dexon-sol-tools-7ae38906926dc09bc10670c361af0d2bf0050426.tar.xz dexon-sol-tools-7ae38906926dc09bc10670c361af0d2bf0050426.tar.zst dexon-sol-tools-7ae38906926dc09bc10670c361af0d2bf0050426.zip |
Update dependency packages
Diffstat (limited to 'packages/utils/src/abi_encoder/evm_data_types/tuple.ts')
-rw-r--r-- | packages/utils/src/abi_encoder/evm_data_types/tuple.ts | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/packages/utils/src/abi_encoder/evm_data_types/tuple.ts b/packages/utils/src/abi_encoder/evm_data_types/tuple.ts deleted file mode 100644 index 5000c85e8..000000000 --- a/packages/utils/src/abi_encoder/evm_data_types/tuple.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { DataItem, SolidityTypes } from 'ethereum-types'; -import * as _ from 'lodash'; - -import { DataTypeFactory } from '../abstract_data_types/interfaces'; -import { AbstractSetDataType } from '../abstract_data_types/types/set'; - -export class TupleDataType extends AbstractSetDataType { - public static matchType(type: string): boolean { - return type === SolidityTypes.Tuple; - } - - public constructor(dataItem: DataItem, dataTypeFactory: DataTypeFactory) { - super(dataItem, dataTypeFactory); - if (!TupleDataType.matchType(dataItem.type)) { - throw new Error(`Tried to instantiate Tuple with bad input: ${dataItem}`); - } - } - - public getSignatureType(): string { - return this._computeSignatureOfMembers(false); - } - - public getSignature(isDetailed?: boolean): string { - if (_.isEmpty(this.getDataItem().name) || !isDetailed) { - return this.getSignatureType(); - } - const name = this.getDataItem().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._computeSignatureOfMembers(isDetailed)}`; - return detailedSignature; - } -} |