Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed unused parameters for improved code readability. #521

Merged
merged 4 commits into from
May 10, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion common/ratelimit.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ type RateBucketParams struct {
}

// GetClientAddress returns the client address from the context. If the header is not empty, it will
// take the ip address located at the `numProxies position from the end of the header. If the ip address cannot be
// take the ip address located at the `numProxies` position from the end of the header. If the ip address cannot be
// found in the header, it will use the connection ip if `allowDirectConnectionFallback` is true. Otherwise, it will return
// an error.
func GetClientAddress(ctx context.Context, header string, numProxies int, allowDirectConnectionFallback bool) (string, error) {
Expand Down
2 changes: 1 addition & 1 deletion retriever/cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ func RetrieverMain(ctx *cli.Context) error {
}

chainClient := retrivereth.NewChainClient(gethClient, logger)
retrieverServiceServer := retriever.NewServer(config, logger, retrievalClient, v, ics, chainClient)
retrieverServiceServer := retriever.NewServer(config, logger, retrievalClient, ics, chainClient)
if err = retrieverServiceServer.Start(context.Background()); err != nil {
log.Fatalln("failed to start retriever service server", err)
}
Expand Down
2 changes: 0 additions & 2 deletions retriever/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
pb "github.com/Layr-Labs/eigenda/api/grpc/retriever"
"github.com/Layr-Labs/eigenda/clients"
"github.com/Layr-Labs/eigenda/core"
"github.com/Layr-Labs/eigenda/encoding"
"github.com/Layr-Labs/eigenda/retriever/eth"
"github.com/Layr-Labs/eigensdk-go/logging"
gcommon "github.com/ethereum/go-ethereum/common"
Expand All @@ -28,7 +27,6 @@ func NewServer(
config *Config,
logger logging.Logger,
retrievalClient clients.RetrievalClient,
verifier encoding.Verifier,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This parameter has not been used and should be removed.

indexedState core.IndexedChainState,
chainClient eth.ChainClient,
) *Server {
Expand Down
2 changes: 1 addition & 1 deletion retriever/server_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package retriever_test

Check failure on line 1 in retriever/server_test.go

View workflow job for this annotation

GitHub Actions / Linter

: # github.com/Layr-Labs/eigenda/retriever_test [github.com/Layr-Labs/eigenda/retriever.test]

import (
"context"
Expand Down Expand Up @@ -71,14 +71,14 @@
log.Fatalf("failed to create new mocked chain data: %s", err)
}

_, v, err := makeTestComponents()

Check failure on line 74 in retriever/server_test.go

View workflow job for this annotation

GitHub Actions / Unit Tests

v declared and not used

Check failure on line 74 in retriever/server_test.go

View workflow job for this annotation

GitHub Actions / Linter

v declared and not used (typecheck)
if err != nil {
log.Fatal(err)
}

retrievalClient = &clientsmock.MockRetrievalClient{}
chainClient = mock.NewMockChainClient()
return retriever.NewServer(config, logger, retrievalClient, v, indexedChainState, chainClient)
return retriever.NewServer(config, logger, retrievalClient, indexedChainState, chainClient)
}

func TestRetrieveBlob(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion test/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ func mustMakeRetriever(cst core.IndexedChainState, logger logging.Logger) (*comm
gethClient := &commonmock.MockEthClient{}
retrievalClient := &clientsmock.MockRetrievalClient{}
chainClient := retrievermock.NewMockChainClient()
server := retriever.NewServer(config, logger, retrievalClient, v, cst, chainClient)
server := retriever.NewServer(config, logger, retrievalClient, cst, chainClient)

return gethClient, TestRetriever{
Server: server,
Expand Down
Loading