diff options
Diffstat (limited to 'packages/utils/src/abi_encoder/abstract_data_types/data_type.ts')
-rw-r--r-- | packages/utils/src/abi_encoder/abstract_data_types/data_type.ts | 10 |
1 files changed, 9 insertions, 1 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 13cc87e2a..5bd6aae03 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 @@ -51,8 +51,16 @@ export abstract class DataType { return value; } + public getSignature(detailed?: boolean): string { + 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 detailedSignature = `${shortName} ${this.getSignatureType()}`; + return detailedSignature; + } + public abstract generateCalldataBlock(value: any, parentBlock?: CalldataBlock): CalldataBlock; public abstract generateValue(calldata: RawCalldata, rules: DecodingRules): any; - public abstract getSignature(): string; + public abstract getSignatureType(): string; public abstract isStatic(): boolean; } |