Skip to content

Commit

Permalink
linter
Browse files Browse the repository at this point in the history
  • Loading branch information
ARR552 committed May 7, 2024
1 parent 1428426 commit 091f18b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 18 deletions.
4 changes: 2 additions & 2 deletions claimtxman/compose_compress_claim.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ type bridgeClaimXParams struct {
}

type ComposeCompressClaim struct {
bridgeContractABI *abi.ABI
bridgeContractABI *abi.ABI
methodClaimAssets abi.Method
methodClaimMessages abi.Method
}
Expand All @@ -62,7 +62,7 @@ func NewComposeCompressClaim() (*ComposeCompressClaim, error) {
return nil, errors.New("method claimMessages not found")
}
return &ComposeCompressClaim{
bridgeContractABI: smcAbi,
bridgeContractABI: smcAbi,
methodClaimAssets: methodClaimAssets,
methodClaimMessages: methodClaimMessages,
}, nil
Expand Down
31 changes: 15 additions & 16 deletions synchronizer/synchronizer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ func TestSyncGer(t *testing.T) {
GlobalExitRoot: common.HexToHash("0xb14c74e4dddf25627a745f46cae6ac98782e2783c3ccc28107c8210e60d58864"),
}
ethermanBlock0 := etherman.Block{
BlockHash: ethBlock0.Hash(),
NetworkID: 0,
BlockHash: ethBlock0.Hash(),
NetworkID: 0,
}
ethermanBlock1 := etherman.Block{
BlockNumber: ethBlock0.NumberU64(),
Expand Down Expand Up @@ -198,7 +198,7 @@ func TestReorg(t *testing.T) {
SyncChunkSize: 10,
}
ctx := mock.MatchedBy(func(ctx context.Context) bool { return ctx != nil })
parentContext := context.Background()
parentContext := context.Background()
m.Etherman.On("GetNetworkID", ctx).Return(uint(0), nil)
m.Storage.On("GetLatestL1SyncedExitRoot", ctx, nil).Return(&etherman.GlobalExitRoot{}, gerror.ErrStorageNotFound).Once()
m.Storage.On("IsLxLyActivated", ctx, nil).Return(true, nil).Once()
Expand Down Expand Up @@ -426,7 +426,7 @@ func TestReorg(t *testing.T) {

exitRoots := &rpcTypes.ExitRoots{
MainnetExitRoot: common.Hash{},
RollupExitRoot: common.Hash{},
RollupExitRoot: common.Hash{},
}
m.ZkEVMClient.
On("ExitRootsByGER", ctx, ger).
Expand Down Expand Up @@ -474,7 +474,7 @@ func TestLatestSyncedBlockEmpty(t *testing.T) {
SyncChunkSize: 10,
}
ctx := mock.MatchedBy(func(ctx context.Context) bool { return ctx != nil })
parentContext := context.Background()
parentContext := context.Background()
m.Etherman.On("GetNetworkID", ctx).Return(uint(0), nil)
m.Storage.On("GetLatestL1SyncedExitRoot", ctx, nil).Return(&etherman.GlobalExitRoot{}, gerror.ErrStorageNotFound).Once()
m.Storage.On("IsLxLyActivated", ctx, nil).Return(true, nil).Once()
Expand Down Expand Up @@ -614,7 +614,7 @@ func TestLatestSyncedBlockEmpty(t *testing.T) {

exitRoots := &rpcTypes.ExitRoots{
MainnetExitRoot: common.Hash{},
RollupExitRoot: common.Hash{},
RollupExitRoot: common.Hash{},
}
m.ZkEVMClient.
On("ExitRootsByGER", ctx, ger).
Expand Down Expand Up @@ -662,7 +662,7 @@ func TestRegularReorg(t *testing.T) {
SyncChunkSize: 10,
}
ctx := mock.MatchedBy(func(ctx context.Context) bool { return ctx != nil })
parentContext := context.Background()
parentContext := context.Background()
m.Etherman.On("GetNetworkID", ctx).Return(uint(0), nil)
m.Storage.On("GetLatestL1SyncedExitRoot", ctx, nil).Return(&etherman.GlobalExitRoot{}, gerror.ErrStorageNotFound).Once()
m.Storage.On("IsLxLyActivated", ctx, nil).Return(true, nil).Once()
Expand Down Expand Up @@ -716,7 +716,6 @@ func TestRegularReorg(t *testing.T) {
Return(ethBlock1bis, nil).
Once()


ti := time.Date(2024, 1, 1, 1, 0, 0, 0, time.UTC)
var depth uint64 = 1
stateBlock0 := &etherman.Block{
Expand Down Expand Up @@ -853,7 +852,7 @@ func TestRegularReorg(t *testing.T) {

exitRoots := &rpcTypes.ExitRoots{
MainnetExitRoot: common.Hash{},
RollupExitRoot: common.Hash{},
RollupExitRoot: common.Hash{},
}
m.ZkEVMClient.
On("ExitRootsByGER", ctx, ger).
Expand Down Expand Up @@ -901,7 +900,7 @@ func TestLatestSyncedBlockEmptyWithExtraReorg(t *testing.T) {
SyncChunkSize: 10,
}
ctx := mock.MatchedBy(func(ctx context.Context) bool { return ctx != nil })
parentContext := context.Background()
parentContext := context.Background()
m.Etherman.On("GetNetworkID", ctx).Return(uint(0), nil)
m.Storage.On("GetLatestL1SyncedExitRoot", ctx, nil).Return(&etherman.GlobalExitRoot{}, gerror.ErrStorageNotFound).Once()
m.Storage.On("IsLxLyActivated", ctx, nil).Return(true, nil).Once()
Expand Down Expand Up @@ -1078,7 +1077,7 @@ func TestLatestSyncedBlockEmptyWithExtraReorg(t *testing.T) {
On("Commit", ctx, m.DbTx).
Return(nil).
Once()

ger := common.HexToHash("0x01")
m.ZkEVMClient.
On("GetLatestGlobalExitRoot", ctx).
Expand All @@ -1087,7 +1086,7 @@ func TestLatestSyncedBlockEmptyWithExtraReorg(t *testing.T) {

exitRoots := &rpcTypes.ExitRoots{
MainnetExitRoot: common.Hash{},
RollupExitRoot: common.Hash{},
RollupExitRoot: common.Hash{},
}
m.ZkEVMClient.
On("ExitRootsByGER", ctx, ger).
Expand Down Expand Up @@ -1135,7 +1134,7 @@ func TestCallFromEmptyBlockAndReorg(t *testing.T) {
SyncChunkSize: 10,
}
ctx := mock.MatchedBy(func(ctx context.Context) bool { return ctx != nil })
parentContext := context.Background()
parentContext := context.Background()
m.Etherman.On("GetNetworkID", ctx).Return(uint(0), nil)
m.Storage.On("GetLatestL1SyncedExitRoot", ctx, nil).Return(&etherman.GlobalExitRoot{}, gerror.ErrStorageNotFound).Once()
m.Storage.On("IsLxLyActivated", ctx, nil).Return(true, nil).Once()
Expand Down Expand Up @@ -1300,7 +1299,7 @@ func TestCallFromEmptyBlockAndReorg(t *testing.T) {
On("Commit", ctx, m.DbTx).
Return(nil).
Once()

ger := common.HexToHash("0x01")
m.ZkEVMClient.
On("GetLatestGlobalExitRoot", ctx).
Expand All @@ -1309,7 +1308,7 @@ func TestCallFromEmptyBlockAndReorg(t *testing.T) {

exitRoots := &rpcTypes.ExitRoots{
MainnetExitRoot: common.Hash{},
RollupExitRoot: common.Hash{},
RollupExitRoot: common.Hash{},
}
m.ZkEVMClient.
On("ExitRootsByGER", ctx, ger).
Expand Down Expand Up @@ -1347,4 +1346,4 @@ func TestCallFromEmptyBlockAndReorg(t *testing.T) {
err := sync.Sync()
require.NoError(t, err)
})
}
}

0 comments on commit 091f18b

Please sign in to comment.