Skip to content

Commit f67d8be

Browse files
committed
fix: handle errors from printTxData
1 parent 2eed5de commit f67d8be

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

cmd/parsebatchl2data/parsebatchl2data.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,10 @@ var ParseBatchL2Data = &cobra.Command{
5858
}
5959
fmt.Println(string(blockDataBytes))
6060

61-
for idx := range l2RawBlock.Transactions {
62-
_ = printTxData(&l2RawBlock.Transactions[idx])
61+
for i := range l2RawBlock.Transactions {
62+
if err := printTxData(&l2RawBlock.Transactions[i]); err != nil {
63+
log.Error().Err(err).Int("tx_index", i).Msg("Failed to print transaction data")
64+
}
6365
}
6466
}
6567
return nil
@@ -122,7 +124,9 @@ func tryRawBatch(rawBatchL2Data []byte) {
122124
log.Error().Err(err).Msg("unable to decode raw l2 batch data")
123125
return
124126
}
125-
for _, t := range rawBatch.Transactions {
126-
_ = printTxData(&t)
127+
for i, t := range rawBatch.Transactions {
128+
if err := printTxData(&t); err != nil {
129+
log.Error().Err(err).Int("tx_index", i).Msg("Failed to print transaction data in forced batch")
130+
}
127131
}
128132
}

0 commit comments

Comments
 (0)