From 223d24606633d70949c577d4d626f169913b0d03 Mon Sep 17 00:00:00 2001 From: Neeraj Kashyap Date: Wed, 22 Nov 2023 05:55:08 -0800 Subject: [PATCH] Modified codegen to exclude unnecessary whitespace --- lib/interface.go | 9 +++++---- lib/version.go | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/interface.go b/lib/interface.go index d8f01c9..5b2e8b6 100644 --- a/lib/interface.go +++ b/lib/interface.go @@ -265,13 +265,14 @@ func ResolveCompounds(abi DecodedABI) DecodedABIWithCompundTypes { // This is the Go template used to generate Solidity interfaces to contracts with a given ABI. // The template is meant to be applied to InterfaceSpecification structs. -const InterfaceTemplate string = ` -{{ if .License }} +const InterfaceTemplate string = `{{- if .License -}} // SPDX-License-Identifier: {{.License}} + {{ end }} -{{- if .Pragma }} +{{- if .Pragma -}} pragma solidity {{.Pragma}}; -{{ end }} + +{{ end -}} // Interface generated by solface: https://github.com/moonstream-to/solface // solface version: {{.SolfaceVersion}} {{- $includeAnnotations := .IncludeAnnotations}} diff --git a/lib/version.go b/lib/version.go index c232eb4..7a8be4d 100644 --- a/lib/version.go +++ b/lib/version.go @@ -1,4 +1,4 @@ package lib // The current version of solface. -var VERSION string = "0.2.1" +var VERSION string = "0.2.2"