Skip to content

Commit

Permalink
ARCO-209: fix PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
pawellewandowski98 committed Oct 30, 2024
1 parent c48ba45 commit 9b5a919
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 35 deletions.
4 changes: 2 additions & 2 deletions internal/k8s_watcher/watcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ type K8sClient interface {

type Watcher struct {
metamorphClient metamorph.TransactionMaintainer
blocktxClient blocktx.BlockClient
blocktxClient blocktx.Watcher
k8sClient K8sClient
logger *slog.Logger
tickerMetamorph Ticker
Expand All @@ -55,7 +55,7 @@ func WithRetryInterval(d time.Duration) func(*Watcher) {
type ServerOption func(f *Watcher)

// New The K8s watcher listens to events coming from Kubernetes. If it detects a metamorph pod which was terminated, then it sets records locked by this pod to unlocked. This is a safety measure for the case that metamorph is terminated ungracefully where it misses to unlock its records itself.
func New(metamorphClient metamorph.TransactionMaintainer, blocktxClient blocktx.BlockClient, k8sClient K8sClient, namespace string, opts ...ServerOption) *Watcher {
func New(metamorphClient metamorph.TransactionMaintainer, blocktxClient blocktx.Watcher, k8sClient K8sClient, namespace string, opts ...ServerOption) *Watcher {
watcher := &Watcher{
metamorphClient: metamorphClient,
blocktxClient: blocktxClient,
Expand Down
4 changes: 2 additions & 2 deletions internal/k8s_watcher/watcher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func TestStartMetamorphWatcher(t *testing.T) {
return 3, nil
},
}
blocktxMock := &btxMocks.BlockClientMock{}
blocktxMock := &btxMocks.WatcherMock{}

iteration := 0
getPodNamesErrTest := tc.getPodNamesErr
Expand Down Expand Up @@ -157,7 +157,7 @@ func TestStartBlocktxWatcher(t *testing.T) {
for _, tc := range tt {
t.Run(tc.name, func(t *testing.T) {
metamorphMock := &mtmMocks.TransactionMaintainerMock{}
blocktxMock := &btxMocks.BlockClientMock{
blocktxMock := &btxMocks.WatcherMock{
DelUnfinishedBlockProcessingFunc: func(_ context.Context, _ string) (int64, error) { return 0, nil },
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/blocktx/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ import (
)

// check if Client implements all necessary interfaces
var _ BlockClient = &Client{}
var _ Watcher = &Client{}
var _ MerkleRootsVerifier = &Client{}

type BlockClient interface {
type Watcher interface {
Health(ctx context.Context) error
ClearTransactions(ctx context.Context, retentionDays int32) (int64, error)
ClearBlocks(ctx context.Context, retentionDays int32) (int64, error)
Expand Down
2 changes: 1 addition & 1 deletion pkg/blocktx/client_mocks.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ package blocktx

//go:generate moq -pkg mocks -out ./mocks/merkle_roots_verifier_mock.go . MerkleRootsVerifier

//go:generate moq -pkg mocks -out ./mocks/blocktx_client_mock.go . BlockClient
//go:generate moq -pkg mocks -out ./mocks/blocktx_client_mock.go . Watcher
56 changes: 28 additions & 28 deletions pkg/blocktx/mocks/blocktx_client_mock.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9b5a919

Please sign in to comment.