Skip to content

Commit

Permalink
op-batcher: Add String methods to txRef (#11904)
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianst authored Sep 17, 2024
1 parent 4490fa8 commit e7758b2
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion op-batcher/batcher/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit e7758b2

Please sign in to comment.