From a2d4b2907184d9480a72fe6f67652489074af86e Mon Sep 17 00:00:00 2001 From: Richard Moore Date: Thu, 30 May 2019 20:19:53 -0400 Subject: [PATCH] Fix event and function fragment formatting. --- packages/abi/src.ts/fragments.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/abi/src.ts/fragments.ts b/packages/abi/src.ts/fragments.ts index ac967f6d72..92b0dcf0b2 100644 --- a/packages/abi/src.ts/fragments.ts +++ b/packages/abi/src.ts/fragments.ts @@ -353,7 +353,7 @@ export abstract class Fragment { result += "(" + this.inputs.map((i) => i.format(expanded)).join(expanded ? ", ": ",") + ") "; // @TODO: Handle returns, modifiers, etc. - if (expanded) { + if (expanded && this.type !== "event") { result += "public "; if ((this).mutabilityState) { result += (this).mutabilityState + " "; @@ -362,7 +362,7 @@ export abstract class Fragment { } if ((this).outputs && (this).outputs.length) { - result += "(" + (this).outputs.map((i: ParamType) => i.format(expanded)).join(", ") + ") "; + result += "returns (" + (this).outputs.map((i: ParamType) => i.format(expanded)).join(", ") + ") "; } }