Skip to content

Commit

Permalink
fix: remove hack to remove unnecessary line in CLI event output
Browse files Browse the repository at this point in the history
  • Loading branch information
willemneal committed Aug 29, 2024
1 parent 313b406 commit d37e44b
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions features/dapp_develop/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,6 @@ func getEventsFromCliTool(ledgerFrom uint32, deployedContractId string, size uin
return jsonEvents, fmt.Errorf("soroban cli get events had error %v, %v", status, err)
}

if len(stdOutLines) > 0 {
// some output was produced to console by the cli events command,
// it could represent a correct or bad result, but need to remove the last line of it regardless
// because if it's correct results will have a last line of 'Latest Ledger: xxxx', which needs to be removed to
// parse the rest as valid json,
stdOutLinesTrimmed = stdOutLines[:len(stdOutLines)-1]
}

// 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`)
// wrap the json objects in json array brackets
Expand Down

0 comments on commit d37e44b

Please sign in to comment.