Skip to content

Commit

Permalink
Merge pull request #2 from AllanCapistrano/feat/tangle-hornet-api-com…
Browse files Browse the repository at this point in the history
…munication

Feat/tangle hornet api communication
  • Loading branch information
AllanCapistrano authored Sep 12, 2023
2 parents 222ca47 + e670f08 commit 9da0c3e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
5 changes: 5 additions & 0 deletions messages/getAllMessagesByIndex.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
}
Expand Down

0 comments on commit 9da0c3e

Please sign in to comment.