Commit 036a14a0 authored by Adrian Sutton's avatar Adrian Sutton Committed by GitHub

op-challenger: Remove unused blockNumberFetcher (#11006)

parent 1bfd7e9b
...@@ -19,8 +19,6 @@ import ( ...@@ -19,8 +19,6 @@ import (
"github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/log"
) )
type blockNumberFetcher func(ctx context.Context) (uint64, error)
// gameSource loads information about the games available to play // gameSource loads information about the games available to play
type gameSource interface { type gameSource interface {
GetGamesAtOrAfter(ctx context.Context, blockHash common.Hash, earliestTimestamp uint64) ([]types.GameMetadata, error) GetGamesAtOrAfter(ctx context.Context, blockHash common.Hash, earliestTimestamp uint64) ([]types.GameMetadata, error)
...@@ -51,7 +49,6 @@ type gameMonitor struct { ...@@ -51,7 +49,6 @@ type gameMonitor struct {
preimages preimageScheduler preimages preimageScheduler
gameWindow time.Duration gameWindow time.Duration
claimer claimer claimer claimer
fetchBlockNumber blockNumberFetcher
allowedGames []common.Address allowedGames []common.Address
l1HeadsSub ethereum.Subscription l1HeadsSub ethereum.Subscription
l1Source *headSource l1Source *headSource
...@@ -78,7 +75,6 @@ func newGameMonitor( ...@@ -78,7 +75,6 @@ func newGameMonitor(
preimages preimageScheduler, preimages preimageScheduler,
gameWindow time.Duration, gameWindow time.Duration,
claimer claimer, claimer claimer,
fetchBlockNumber blockNumberFetcher,
allowedGames []common.Address, allowedGames []common.Address,
l1Source MinimalSubscriber, l1Source MinimalSubscriber,
) *gameMonitor { ) *gameMonitor {
...@@ -90,7 +86,6 @@ func newGameMonitor( ...@@ -90,7 +86,6 @@ func newGameMonitor(
source: source, source: source,
gameWindow: gameWindow, gameWindow: gameWindow,
claimer: claimer, claimer: claimer,
fetchBlockNumber: fetchBlockNumber,
allowedGames: allowedGames, allowedGames: allowedGames,
l1Source: &headSource{inner: l1Source}, l1Source: &headSource{inner: l1Source},
} }
......
...@@ -155,11 +155,6 @@ func setupMonitorTest( ...@@ -155,11 +155,6 @@ func setupMonitorTest(
) (*gameMonitor, *stubGameSource, *stubScheduler, *mockNewHeadSource, *stubPreimageScheduler, *mockScheduler) { ) (*gameMonitor, *stubGameSource, *stubScheduler, *mockNewHeadSource, *stubPreimageScheduler, *mockScheduler) {
logger := testlog.Logger(t, log.LevelDebug) logger := testlog.Logger(t, log.LevelDebug)
source := &stubGameSource{} source := &stubGameSource{}
i := uint64(1)
fetchBlockNum := func(ctx context.Context) (uint64, error) {
i++
return i, nil
}
sched := &stubScheduler{} sched := &stubScheduler{}
preimages := &stubPreimageScheduler{} preimages := &stubPreimageScheduler{}
mockHeadSource := &mockNewHeadSource{} mockHeadSource := &mockNewHeadSource{}
...@@ -172,7 +167,6 @@ func setupMonitorTest( ...@@ -172,7 +167,6 @@ func setupMonitorTest(
preimages, preimages,
time.Duration(0), time.Duration(0),
stubClaimer, stubClaimer,
fetchBlockNum,
allowedGames, allowedGames,
mockHeadSource, mockHeadSource,
) )
......
...@@ -251,7 +251,7 @@ func (s *Service) initLargePreimages() error { ...@@ -251,7 +251,7 @@ func (s *Service) initLargePreimages() error {
} }
func (s *Service) initMonitor(cfg *config.Config) { func (s *Service) initMonitor(cfg *config.Config) {
s.monitor = newGameMonitor(s.logger, s.l1Clock, s.factoryContract, s.sched, s.preimages, cfg.GameWindow, s.claimer, s.l1Client.BlockNumber, cfg.GameAllowlist, s.pollClient) s.monitor = newGameMonitor(s.logger, s.l1Clock, s.factoryContract, s.sched, s.preimages, cfg.GameWindow, s.claimer, cfg.GameAllowlist, s.pollClient)
} }
func (s *Service) Start(ctx context.Context) error { func (s *Service) Start(ctx context.Context) error {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment