Skip to content

Commit

Permalink
fix: satsify linter
Browse files Browse the repository at this point in the history
  • Loading branch information
brianluong committed Dec 19, 2023
1 parent 1a7a578 commit b3d6480
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion internal/metadata/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func (c *ChainMetadataStore) ProcessBlockHeightUpdate(groupID, upstreamID string
}
}

func (c *ChainMetadataStore) ProcessErrorUpdate(groupID, upstreamID string, err error) {
func (c *ChainMetadataStore) ProcessErrorUpdate(_, upstreamID string, err error) {
c.opChannel <- func() {
c.updateErrorForUpstream(upstreamID, err)
}
Expand Down
8 changes: 4 additions & 4 deletions internal/route/node_filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ type HasEnoughPeers struct {
minimumPeerCount uint64
}

func (f *HasEnoughPeers) Apply(_ metadata.RequestMetadata, upstreamConfig *config.UpstreamConfig, numUpstreamsInPriorityGroup int) bool {
func (f *HasEnoughPeers) Apply(_ metadata.RequestMetadata, upstreamConfig *config.UpstreamConfig, _ int) bool {
upstreamStatus := f.healthCheckManager.GetUpstreamStatus(upstreamConfig.ID)
peerCheck, _ := upstreamStatus.PeerCheck.(*checks.PeerCheck)

Expand Down Expand Up @@ -79,7 +79,7 @@ type IsDoneSyncing struct {
logger *zap.Logger
}

func (f *IsDoneSyncing) Apply(_ metadata.RequestMetadata, upstreamConfig *config.UpstreamConfig, numUpstreamsInPriorityGroup int) bool {
func (f *IsDoneSyncing) Apply(_ metadata.RequestMetadata, upstreamConfig *config.UpstreamConfig, _ int) bool {
upstreamStatus := f.healthCheckManager.GetUpstreamStatus(upstreamConfig.ID)

isSyncingCheck, _ := upstreamStatus.SyncingCheck.(*checks.SyncingCheck)
Expand Down Expand Up @@ -116,7 +116,7 @@ type IsCloseToGlobalMaxHeight struct {
func (f *IsCloseToGlobalMaxHeight) Apply(
_ metadata.RequestMetadata,
upstreamConfig *config.UpstreamConfig,
numUpstreamsInPriorityGroup int,
_ int,
) bool {
status := f.chainMetadataStore.GetBlockHeightStatus(upstreamConfig.GroupID, upstreamConfig.ID)

Expand Down Expand Up @@ -206,7 +206,7 @@ type AreMethodsAllowed struct {
func (f *AreMethodsAllowed) Apply(
requestMetadata metadata.RequestMetadata,
upstreamConfig *config.UpstreamConfig,
numUpstreamsInPriorityGroup int,
_ int,
) bool {
for _, method := range requestMetadata.Methods {
// Check methods that are have been disabled on the upstream.
Expand Down
8 changes: 4 additions & 4 deletions internal/server/web_server_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ func TestServeHTTP_ForwardsToCorrectNodeTypeBasedOnStatefulness(t *testing.T) {
expectedBlockTxCount := 29

fullNodeUpstream := setUpHealthyUpstream(t, map[string]func(t *testing.T, request jsonrpc.SingleRequestBody) jsonrpc.SingleResponseBody{
statefulMethod: func(t *testing.T, _ jsonrpc.SingleRequestBody) jsonrpc.SingleResponseBody {
statefulMethod: func(t *testing.T, _ jsonrpc.SingleRequestBody) jsonrpc.SingleResponseBody { //nolint:unparam // test method always returns err

Check failure on line 121 in internal/server/web_server_e2e_test.go

View workflow job for this annotation

GitHub Actions / Code linting with golangci-lint

directive `//nolint:unparam // test method always returns err` is unused for linter "unparam" (nolintlint)
t.Helper()
t.Errorf("Unexpected call to stateful method %s on a full node!", statefulMethod)

Expand Down Expand Up @@ -146,7 +146,7 @@ func TestServeHTTP_ForwardsToCorrectNodeTypeBasedOnStatefulness(t *testing.T) {
ID: *request.ID,
}
},
nonStatefulMethod: func(t *testing.T, _ jsonrpc.SingleRequestBody) jsonrpc.SingleResponseBody {
nonStatefulMethod: func(t *testing.T, _ jsonrpc.SingleRequestBody) jsonrpc.SingleResponseBody { //nolint:unparam // test method always returns err

Check failure on line 149 in internal/server/web_server_e2e_test.go

View workflow job for this annotation

GitHub Actions / Code linting with golangci-lint

directive `//nolint:unparam // test method always returns err` is unused for linter "unparam" (nolintlint)
t.Helper()
t.Errorf("Unexpected call to method %s: archive node is at lower priority!", nonStatefulMethod)

Expand Down Expand Up @@ -198,13 +198,13 @@ func TestServeHTTP_ForwardsToCorrectNodeTypeBasedOnStatefulnessBatch(t *testing.
expectedBlockTxCount := 29

fullNodeUpstream := setUpHealthyUpstream(t, map[string]func(t *testing.T, request jsonrpc.SingleRequestBody) jsonrpc.SingleResponseBody{
statefulMethod: func(t *testing.T, _ jsonrpc.SingleRequestBody) jsonrpc.SingleResponseBody {
statefulMethod: func(t *testing.T, _ jsonrpc.SingleRequestBody) jsonrpc.SingleResponseBody { //nolint:unparam // test method always returns err

Check failure on line 201 in internal/server/web_server_e2e_test.go

View workflow job for this annotation

GitHub Actions / Code linting with golangci-lint

directive `//nolint:unparam // test method always returns err` is unused for linter "unparam" (nolintlint)
t.Helper()
t.Errorf("Unexpected call to stateful method %s on a full node!", statefulMethod)

return jsonrpc.SingleResponseBody{}
},
nonStatefulMethod: func(t *testing.T, _ jsonrpc.SingleRequestBody) jsonrpc.SingleResponseBody {
nonStatefulMethod: func(t *testing.T, _ jsonrpc.SingleRequestBody) jsonrpc.SingleResponseBody { //nolint:unparam // test method always returns err
t.Helper()
t.Errorf("Unexpected call to non-stateful method %s on a full node!", nonStatefulMethod)

Expand Down

0 comments on commit b3d6480

Please sign in to comment.