From 3f767e550cb5efa85d55f13c2aa255f87ffa2bab Mon Sep 17 00:00:00 2001 From: AllanCapistrano Date: Mon, 11 Sep 2023 12:07:50 -0300 Subject: [PATCH 1/2] chore: add TODO --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index 1d77b85..93c28b8 100644 --- a/main.go +++ b/main.go @@ -16,7 +16,7 @@ func main() { fmt.Println(nodeInfo) // Submitting some message. - // messages.SubmitMessage(nodeURL, "LB_REPLY", "{asdfghjkl}", 15) + // messages.SubmitMessage(nodeURL, "LB_REPLY", "{asdfghjkl}", 15) // TODO: Conseguir ler esse tipo de mensagem // Reading some messages by an index. messages := messages.GetAllMessagesByIndex(nodeURL, "LB_REPLY") From abdcba5e81958b3cd616d424b2c9192a04d207d7 Mon Sep 17 00:00:00 2001 From: AllanCapistrano Date: Tue, 12 Sep 2023 12:11:59 -0300 Subject: [PATCH 2/2] fix: payload with horizontal tab --- messages/getAllMessagesByIndex.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/messages/getAllMessagesByIndex.go b/messages/getAllMessagesByIndex.go index 3c8167c..9e2c2f3 100644 --- a/messages/getAllMessagesByIndex.go +++ b/messages/getAllMessagesByIndex.go @@ -76,6 +76,11 @@ func formatMessagePayload(message iotago.Message) Message { } else { log.Panic("Unexpected array length.") } + } else if strings.Contains(payloadInString, "\t") { + payloadTemp := strings.Split(payloadInString, "\t") + + index = payloadTemp[0] + content = payloadTemp[1] } else { log.Fatal("Malformed payload.") }