Skip to content

Commit

Permalink
feat: better log messages for tuna blocks
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Gianelloni <[email protected]>
  • Loading branch information
wolf31o2 committed Sep 2, 2023
1 parent cba12f1 commit d6c3a08
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion internal/indexer/indexer.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,22 @@ func (i *Indexer) handleEvent(evt event.Event) error {
i.lastBlockData = blockData
// TODO: do the thing

logger.Infof("found updated datum: %#v", blockData)
messageBytes, err := hex.DecodeString(blockData.Message)
if err != nil {
panic(err)
}
message = string(messageBytes)

logger.Infof("found updated datum: block number: %d, hash: %s, leading zeros: %d, difficulty number: %d, epoch time: %d, real time now: %d, message: %s",
blockData.BlockNumber,
blockData.TargetHash,
blockData.LeadingZeros,
blockData.DifficultyNumber,
blockData.EpochTime,
blockData.RealTimeNow,
message,
)


// Restart workers for new datum
if i.tipReached {

Check failure on line 174 in internal/indexer/indexer.go

View workflow job for this annotation

GitHub Actions / lint (1.19.x, ubuntu-latest)

undefined: message
Expand Down

0 comments on commit d6c3a08

Please sign in to comment.