Skip to content

Commit

Permalink
feat: Track last sent slot and send block fees in main.go
Browse files Browse the repository at this point in the history
  • Loading branch information
yusufyian committed Jul 7, 2024
1 parent 2eb1dfa commit 1a26714
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions hypergrid-aide/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,22 +80,27 @@ func main() {
println("blocks: ", len(blocks))
if len(blocks) > 0 {
println("SendGridBlockFees")
resp, err := cosmos.SendGridBlockFees(account, gridId, blocks)
if err != nil {
log.Fatal(err)
resp, err_send := cosmos.SendGridBlockFees(account, gridId, blocks)
if err_send != nil {
log.Fatal(err_send)
println("SendGridBlockFees fail")
} else {
println("SendGridBlockFees success")
last_sent_slot = blocks[len(blocks)-1].Slot
_, err = tools.SetLastSentSlot(last_sent_slot)
if err != nil {
log.Fatal(err)
}

}
fmt.Print("MsgCreateGridTxFee:", resp)
} else {
last_sent_slot = start_slot + AIDE_GET_BLOCKS_COUNT_LIMIT - 1
}
_, err = tools.SetLastSentSlot(last_sent_slot)
if err != nil {
log.Fatal(err)
}

_, err = tools.SetLastSentSlot(last_sent_slot)
if err != nil {
log.Fatal(err)
}

queryResp, err := cosmos.QueryAllGridBlockFees()
Expand Down

0 comments on commit 1a26714

Please sign in to comment.