Skip to content

Commit 19008d4

Browse files
committed
lint & format
1 parent 64a6f3d commit 19008d4

File tree

9 files changed

+11
-14
lines changed

9 files changed

+11
-14
lines changed

bot/types/const.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package types
22

33
import (
4-
"errors"
54
"fmt"
65
)
76

@@ -14,7 +13,7 @@ const (
1413

1514
func (b BotType) Validate() error {
1615
if b != BotTypeExecutor && b != BotTypeChallenger {
17-
return errors.New(fmt.Sprintf("invalid bot type: %s", b))
16+
return fmt.Errorf("invalid bot type: %s", b)
1817
}
1918
return nil
2019
}

challenger/child/child.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ type Child struct {
3737

3838
finalizingBlockHeight uint64
3939

40-
challengeCh chan<- challengertypes.Challenge
41-
4240
// status info
4341
lastUpdatedOracleL1Height uint64
4442
lastFinalizedDepositL1BlockHeight uint64

challenger/eventhandler/challenge.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ func (ch *ChallengeEventHandler) CheckValue(events []challengertypes.ChallengeEv
1717
for _, event := range events {
1818
pendingEvent, ok := ch.GetPendingEvent(event.Id())
1919
if !ok {
20-
// might not happend because child always syncs later than host.
20+
// might not happened because child always syncs later than host.
2121
return nil, nil, errors.Wrap(nodetypes.ErrIgnoreAndTryLater, fmt.Sprintf("pending event not found: %s", event.String()))
2222
}
2323

challenger/host/deposit.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ func (h *Host) initiateDepositHandler(_ context.Context, args nodetypes.EventHan
1919
if err != nil {
2020
return err
2121
}
22-
if bridgeId != uint64(h.BridgeId()) {
22+
if bridgeId != h.BridgeId() {
2323
// pass other bridge deposit event
2424
return nil
2525
}

challenger/host/output.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ func (h *Host) proposeOutputHandler(_ context.Context, args nodetypes.EventHandl
1515
if err != nil {
1616
return err
1717
}
18-
if bridgeId != uint64(h.BridgeId()) {
18+
if bridgeId != h.BridgeId() {
1919
// pass other bridge output proposal event
2020
return nil
2121
}

executor/host/batch.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ func (h *Host) updateBatchInfoHandler(_ context.Context, args nodetypes.EventHan
3131
if err != nil {
3232
return err
3333
}
34-
if bridgeId != uint64(h.BridgeId()) {
34+
if bridgeId != h.BridgeId() {
3535
// pass other bridge deposit event
3636
return nil
3737
}

executor/host/deposit.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ func (h *Host) initiateDepositHandler(_ context.Context, args nodetypes.EventHan
1616
if err != nil {
1717
return err
1818
}
19-
if bridgeId != uint64(h.BridgeId()) {
19+
if bridgeId != h.BridgeId() {
2020
// pass other bridge deposit event
2121
return nil
2222
}

executor/host/withdraw.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ func (h *Host) proposeOutputHandler(_ context.Context, args nodetypes.EventHandl
1414
if err != nil {
1515
return err
1616
}
17-
if bridgeId != uint64(h.BridgeId()) {
17+
if bridgeId != h.BridgeId() {
1818
// pass other bridge output proposal event
1919
return nil
2020
}
@@ -40,7 +40,7 @@ func (h *Host) finalizeWithdrawalHandler(_ context.Context, args nodetypes.Event
4040
if err != nil {
4141
return err
4242
}
43-
if bridgeId != uint64(h.BridgeId()) {
43+
if bridgeId != h.BridgeId() {
4444
// pass other bridge withdrawal event
4545
return nil
4646
}

provider/child/tree.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package child
22

3-
func (ch *BaseChild) InitializeTree(blockHeight uint64) bool {
4-
if ch.initializeTreeFn != nil {
5-
ok, err := ch.initializeTreeFn(blockHeight)
3+
func (b *BaseChild) InitializeTree(blockHeight uint64) bool {
4+
if b.initializeTreeFn != nil {
5+
ok, err := b.initializeTreeFn(blockHeight)
66
if err != nil {
77
panic("failed to initialize working tree: " + err.Error())
88
}

0 commit comments

Comments
 (0)