Skip to content

Commit

Permalink
fix: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
alok committed Jan 12, 2024
1 parent 231e6e2 commit fff2f6e
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 14 deletions.
4 changes: 2 additions & 2 deletions pkg/apiserver/apiserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func (a *Service) registerStatsEndpoints() {

w.Header().Set("Content-Type", "application/json")
w.WriteHeader(http.StatusOK)
w.Write(resp)
_, _ = w.Write(resp)
})

a.router.HandleFunc("/stats", func(w http.ResponseWriter, r *http.Request) {
Expand All @@ -119,7 +119,7 @@ func (a *Service) registerStatsEndpoints() {

w.Header().Set("Content-Type", "application/json")
w.WriteHeader(http.StatusOK)
w.Write(resp)
_, _ = w.Write(resp)
})
}

Expand Down
3 changes: 3 additions & 0 deletions pkg/node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,14 @@ func NewNode(opts *Options) (*Node, error) {
)
if err != nil {
log.Fatal().Err(err).Msg("failed to instantiate preconf contract")
cancel()
return nil, err
}

oracleContract, err := rollupclient.NewOracle(opts.OracleContractAddr, settlementClient)
if err != nil {
log.Fatal().Err(err).Msg("failed to instantiate oracle contract")
cancel()
return nil, err
}

Expand All @@ -121,6 +123,7 @@ func NewNode(opts *Options) (*Node, error) {
)
if err != nil {
log.Fatal().Err(err).Msg("failed to set builder mapping")
cancel()
return nil, err
}
}
Expand Down
1 change: 1 addition & 0 deletions pkg/settler/settler.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ func (s *Settler) Start(ctx context.Context) <-chan struct{} {
for {
select {
case <-ctx.Done():
unsub()
return
case settlement, more := <-settlementChan:
if !more {
Expand Down
1 change: 1 addition & 0 deletions pkg/updater/updater.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ func (u *Updater) Start(ctx context.Context) <-chan struct{} {
for {
select {
case <-ctx.Done():
unsub()
return
case winner, more := <-winnerChan:
if !more {
Expand Down
22 changes: 10 additions & 12 deletions pkg/updater/updater_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,19 +120,17 @@ func TestUpdater(t *testing.T) {
if count == 10 {
break
}
select {
case settlement := <-testWinnerRegister.settlements:
if settlement.blockNum != 5 {
t.Fatal("wrong block number")
}
if settlement.builder != "test" {
t.Fatal("wrong builder")
}
if settlement.isSlash {
t.Fatal("should not be slash")
}
count++
settlement := <-testWinnerRegister.settlements
if settlement.blockNum != 5 {
t.Fatal("wrong block number")
}
if settlement.builder != "test" {
t.Fatal("wrong builder")
}
if settlement.isSlash {
t.Fatal("should not be slash")
}
count++
}

select {
Expand Down

0 comments on commit fff2f6e

Please sign in to comment.