From f7de26f65c4aebcf5d27dab07f4b75081b48d7ac Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Wed, 17 Oct 2018 17:13:32 +0100 Subject: chore: make abi `type` prop always of type string to fix TypeDoc issue related to reading in artifacts from JSON files --- packages/ethereum-types/src/index.ts | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'packages/ethereum-types') diff --git a/packages/ethereum-types/src/index.ts b/packages/ethereum-types/src/index.ts index ddd472010..eff38711a 100644 --- a/packages/ethereum-types/src/index.ts +++ b/packages/ethereum-types/src/index.ts @@ -20,7 +20,9 @@ export type ConstructorStateMutability = 'nonpayable' | 'payable'; export type StateMutability = 'pure' | 'view' | ConstructorStateMutability; export interface MethodAbi { - type: 'function'; // We hardcode this here b/c doc pages cannot render an enum value + // Ideally this would be set to: `'function'` but then TS complains when artifacts are loaded + // from JSON files, and this value has type `string` not type `'function'` + type: string; name: string; inputs: DataItem[]; outputs: DataItem[]; @@ -30,14 +32,18 @@ export interface MethodAbi { } export interface ConstructorAbi { - type: 'constructor'; // We hardcode this here b/c doc pages cannot render an enum value + // Ideally this would be set to: `'constructor'` but then TS complains when artifacts are loaded + // from JSON files, and this value has type `string` not type `'constructor'` + type: string; inputs: DataItem[]; payable: boolean; stateMutability: ConstructorStateMutability; } export interface FallbackAbi { - type: 'fallback'; // We hardcode this here b/c doc pages cannot render an enum value + // Ideally this would be set to: `'fallback'` but then TS complains when artifacts are loaded + // from JSON files, and this value has type `string` not type `'fallback'` + type: string; payable: boolean; } @@ -46,7 +52,9 @@ export interface EventParameter extends DataItem { } export interface EventAbi { - type: 'event'; // We hardcode this here b/c doc pages cannot render an enum value + // Ideally this would be set to: `'event'` but then TS complains when artifacts are loaded + // from JSON files, and this value has type `string` not type `'event'` + type: string; name: string; inputs: EventParameter[]; anonymous: boolean; -- cgit v1.2.3