Skip to content

Commit

Permalink
add Milliseconds() to L2BlockRefSource
Browse files Browse the repository at this point in the history
  • Loading branch information
fahimahmedx committed Jul 30, 2024
1 parent 9726fe3 commit 3b5d76c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion op-node/rollup/derive/l2block_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ type L2BlockRefSource interface {
NumberU64() uint64
Time() uint64
Transactions() types.Transactions
Milliseconds() uint64
}

// L2BlockToBlockRef extracts the essential L2BlockRef information from an L2
Expand All @@ -47,7 +48,7 @@ func L2BlockToBlockRef(rollupCfg *rollup.Config, block L2BlockRefSource) (eth.L2
if tx.Type() != types.DepositTxType {
return eth.L2BlockRef{}, fmt.Errorf("first payload tx has unexpected tx type: %d", tx.Type())
}
info, err := L1BlockInfoFromBytes(rollupCfg, timeint.FromUint64SecToMilli(block.Time()), tx.Data())
info, err := L1BlockInfoFromBytes(rollupCfg, timeint.FromUint64MilliToMilli(block.Milliseconds()), tx.Data())
if err != nil {
return eth.L2BlockRef{}, fmt.Errorf("failed to parse L1 info deposit tx from L2 block: %w", err)
}
Expand Down

0 comments on commit 3b5d76c

Please sign in to comment.