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

Bump github.com/coinbase/rosetta-sdk-go from 0.8.6 to 0.8.7 in /hedera-mirror-rosetta #9726

Merged
Show file tree
Hide file tree
Changes from all commits
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
5 changes: 0 additions & 5 deletions hedera-mirror-rosetta/app/middleware/health.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ package middleware
import (
"context"
"fmt"
"net/http"
"time"

"github.com/coinbase/rosetta-sdk-go/client"
Expand Down Expand Up @@ -92,10 +91,6 @@ func (c *healthController) Routes() server.Routes {
}
}

func (c *healthController) ContextFromRequest(r *http.Request) context.Context {
return r.Context()
}

func checkNetworkStatus(port uint16) func(ctx context.Context) error {
serverUrl := fmt.Sprintf("http://localhost:%d", port)
cfg := client.NewConfiguration(serverUrl, "readiness-check", nil)
Expand Down
8 changes: 0 additions & 8 deletions hedera-mirror-rosetta/app/middleware/health_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,3 @@ func TestReadiness(t *testing.T) {
require.Equal(t, httpStatus, tracingResponseWriter.statusCode)
}
}

func TestHealthContextFromRequest(t *testing.T) {
healthController, err := NewHealthController(&config.Config{})
require.NoError(t, err)

request := httptest.NewRequest("GET", "http://localhost"+readinessPath, nil)
require.Equal(t, request.Context(), healthController.ContextFromRequest(request))
}
5 changes: 0 additions & 5 deletions hedera-mirror-rosetta/app/middleware/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
package middleware

import (
"context"
"net/http"

"github.com/coinbase/rosetta-sdk-go/server"
Expand Down Expand Up @@ -87,10 +86,6 @@ func (c *metricsController) Routes() server.Routes {
}
}

func (c *metricsController) ContextFromRequest(r *http.Request) context.Context {
return r.Context()
}

// MetricsMiddleware instruments HTTP requests with request metrics
func MetricsMiddleware(next http.Handler) http.Handler {
return middleware.Instrument{
Expand Down
6 changes: 0 additions & 6 deletions hedera-mirror-rosetta/app/middleware/metrics_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,3 @@ func TestMetrics(t *testing.T) {
require.Contains(t, responseWriter.Header().Get("Content-Type"), "text/plain")
require.Contains(t, response, "promhttp_metric_handler_requests_total")
}

func TestMetricsContextFromRequest(t *testing.T) {
metricsController := NewMetricsController()
request := httptest.NewRequest("GET", "http://localhost"+metricsPath, nil)
require.Equal(t, request.Context(), metricsController.ContextFromRequest(request))
}
2 changes: 1 addition & 1 deletion hedera-mirror-rosetta/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.22

require (
github.com/Code-Hex/go-generics-cache v1.5.1
github.com/coinbase/rosetta-sdk-go v0.8.6
github.com/coinbase/rosetta-sdk-go v0.8.7
github.com/coinbase/rosetta-sdk-go/types v1.0.0
github.com/cucumber/godog v0.15.0
github.com/ethereum/go-ethereum v1.14.11
Expand Down
4 changes: 2 additions & 2 deletions hedera-mirror-rosetta/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -471,8 +471,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ
github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo=
github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ=
github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI=
github.com/coinbase/rosetta-sdk-go v0.8.6 h1:FQ8ApWTZIsung1AsTv+DjXR7RwKnS6MQXzLcXtBNyjc=
github.com/coinbase/rosetta-sdk-go v0.8.6/go.mod h1:LD9qAq1m+pwAqEBrzNTjDy9VTYEDgeHiiltVTVyHfXI=
github.com/coinbase/rosetta-sdk-go v0.8.7 h1:rC3JvdoLWlOHauHrULpVJ/Bof/jZHP8mJCTQ9atWkyY=
github.com/coinbase/rosetta-sdk-go v0.8.7/go.mod h1:xIu+9M4EN/WkAy/H67lP8iu+/Fy3Wbyihmv8L+XacWM=
github.com/coinbase/rosetta-sdk-go/types v1.0.0 h1:jpVIwLcPoOeCR6o1tU+Xv7r5bMONNbHU7MuEHboiFuA=
github.com/coinbase/rosetta-sdk-go/types v1.0.0/go.mod h1:eq7W2TMRH22GTW0N0beDnN931DW0/WOI1R2sdHNHG4c=
github.com/consensys/bavard v0.1.13 h1:oLhMLOFGTLdlda/kma4VOJazblc7IM5y5QPd2A/YjhQ=
Expand Down
14 changes: 7 additions & 7 deletions hedera-mirror-rosetta/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func newBlockchainOnlineRouter(
baseService := services.NewOnlineBaseService(blockRepo, transactionRepo)

networkAPIService := services.NewNetworkAPIService(baseService, addressBookEntryRepo, network, version)
networkAPIController := server.NewNetworkAPIController(networkAPIService, asserter, nil)
networkAPIController := server.NewNetworkAPIController(networkAPIService, asserter)

blockAPIService := services.NewBlockAPIService(
accountRepo,
Expand All @@ -96,10 +96,10 @@ func newBlockchainOnlineRouter(
rosettaConfig.Response.MaxTransactionsInBlock,
serverContext,
)
blockAPIController := server.NewBlockAPIController(blockAPIService, asserter, nil)
blockAPIController := server.NewBlockAPIController(blockAPIService, asserter)

mempoolAPIService := services.NewMempoolAPIService()
mempoolAPIController := server.NewMempoolAPIController(mempoolAPIService, asserter, nil)
mempoolAPIController := server.NewMempoolAPIController(mempoolAPIService, asserter)

constructionAPIService, err := services.NewConstructionAPIService(
accountRepo,
Expand All @@ -110,10 +110,10 @@ func newBlockchainOnlineRouter(
if err != nil {
return nil, err
}
constructionAPIController := server.NewConstructionAPIController(constructionAPIService, asserter, nil)
constructionAPIController := server.NewConstructionAPIController(constructionAPIService, asserter)

accountAPIService := services.NewAccountAPIService(baseService, accountRepo, rosettaConfig.Shard, rosettaConfig.Realm)
accountAPIController := server.NewAccountAPIController(accountAPIService, asserter, nil)
accountAPIController := server.NewAccountAPIController(accountAPIService, asserter)
healthController, err := middleware.NewHealthController(rosettaConfig)
metricsController := middleware.NewMetricsController()
if err != nil {
Expand Down Expand Up @@ -151,15 +151,15 @@ func newBlockchainOfflineRouter(
if err != nil {
return nil, err
}
constructionAPIController := server.NewConstructionAPIController(constructionAPIService, asserter, nil)
constructionAPIController := server.NewConstructionAPIController(constructionAPIService, asserter)
healthController, err := middleware.NewHealthController(rosettaConfig)
if err != nil {
return nil, err
}

metricsController := middleware.NewMetricsController()
networkAPIService := services.NewNetworkAPIService(baseService, nil, network, version)
networkAPIController := server.NewNetworkAPIController(networkAPIService, asserter, nil)
networkAPIController := server.NewNetworkAPIController(networkAPIService, asserter)

return server.NewRouter(constructionAPIController, healthController, metricsController, networkAPIController), nil
}
Expand Down
Loading