From b5257e65d847393bd75d129ce34f837f50685944 Mon Sep 17 00:00:00 2001 From: Willem Wyndham Date: Fri, 30 Aug 2024 07:40:34 -0400 Subject: [PATCH] fix: assume valid json in events output (#104) --- features/dapp_develop/cli.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/features/dapp_develop/cli.go b/features/dapp_develop/cli.go index 076e2d7..fe70f46 100644 --- a/features/dapp_develop/cli.go +++ b/features/dapp_develop/cli.go @@ -93,14 +93,13 @@ func getEventsFromCliTool(ledgerFrom uint32, deployedContractId string, size uin status, stdOutLines, err := e2e.RunCommand(envCmd, e2eConfig) var jsonEvents []map[string]interface{} - var stdOutLinesTrimmed []string if status != 0 || err != nil { return jsonEvents, fmt.Errorf("soroban cli get events had error %v, %v", status, err) } // put commas between any json event objects if more than one found - stdOutEventsValidJson := strings.ReplaceAll(strings.Join(stdOutLinesTrimmed, "\n"), `\n}\n{\n`, `\n}\n,\n{\n`) + stdOutEventsValidJson := strings.ReplaceAll(strings.Join(stdOutLines, "\n"), `\n}\n{\n`, `\n}\n,\n{\n`) // wrap the json objects in json array brackets stdOutEventsValidJson = "[" + stdOutEventsValidJson + "]"