From eac4844a6f312d6d28d6306e0f2ad14a0dc56023 Mon Sep 17 00:00:00 2001 From: Sebastian Stammler Date: Fri, 13 Sep 2024 09:20:56 +0200 Subject: [PATCH] op-batcher: Add String methods to txRef --- op-batcher/batcher/driver.go | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/op-batcher/batcher/driver.go b/op-batcher/batcher/driver.go index 9dbd9e802688..fd56a1cebc6b 100644 --- a/op-batcher/batcher/driver.go +++ b/op-batcher/batcher/driver.go @@ -42,6 +42,25 @@ type txRef struct { isBlob bool } +func (r txRef) String() string { + return r.string(func(id txID) string { return id.String() }) +} + +func (r txRef) TerminalString() string { + return r.string(func(id txID) string { return id.TerminalString() }) +} + +func (r txRef) string(txIDStringer func(txID) string) string { + if r.isCancel { + if r.isBlob { + return "blob-cancellation" + } else { + return "calldata-cancellation" + } + } + return txIDStringer(r.id) +} + type L1Client interface { HeaderByNumber(ctx context.Context, number *big.Int) (*types.Header, error) NonceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (uint64, error) @@ -455,7 +474,6 @@ func (l *BatchSubmitter) publishStateToL1(queue *txmgr.Queue[txRef], receiptsCh return } err := l.publishTxToL1(l.killCtx, queue, receiptsCh, daGroup) - if err != nil { if err != io.EOF { l.Log.Error("Error publishing tx to l1", "err", err)