Skip to content

Commit

Permalink
refactor(tx-submitter): introduce constant for block time
Browse files Browse the repository at this point in the history
  • Loading branch information
WorldDogs committed Nov 12, 2024
1 parent 18a51b2 commit 4e40150
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tx-submitter/l1checker/blockmonitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import (
"github.com/morph-l2/go-ethereum/log"
)

const blockTime = time.Second * 12

type IBlockMonitor interface {
BlockNotIncreasedIn(time.Duration) bool
}
Expand All @@ -24,7 +26,7 @@ type BlockMonitor struct {

func NewBlockMonitor(notGrowthInBlocks int64, client iface.L1Client) *BlockMonitor {
return &BlockMonitor{
blockGenerateTime: time.Second * 12,
blockGenerateTime: blockTime,
latestBlockTime: time.Time{},
noGrowthBlockCntTime: time.Second * time.Duration(notGrowthInBlocks) * 12,
client: client,
Expand Down

0 comments on commit 4e40150

Please sign in to comment.