From dd3434115ee126f3b432644e185e41031cfbc2d3 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Thu, 16 Nov 2023 17:44:04 +0100 Subject: [PATCH] [Relayminer] chore: cleanup after 177 (#190) * chore: fix godoc comments * chore: remove unused code --- pkg/deps/config/config.go | 13 ++++++------- pkg/relayer/cmd/cmd.go | 38 -------------------------------------- 2 files changed, 6 insertions(+), 45 deletions(-) diff --git a/pkg/deps/config/config.go b/pkg/deps/config/config.go index 9621fa1de..8a73cd40c 100644 --- a/pkg/deps/config/config.go +++ b/pkg/deps/config/config.go @@ -36,9 +36,9 @@ func SupplyConfig( return deps, nil } -// NewSupplyEventsQueryClientFn constructs an EventsQueryClient instance and returns -// a new depinject.Config which is supplied with the given deps and the new -// EventsQueryClient. +// NewSupplyEventsQueryClientFn returns a new function which constructs an +// EventsQueryClient instance and returns a new depinject.Config which is supplied +// with the given deps and the new EventsQueryClient. func NewSupplyEventsQueryClientFn( pocketNodeWebsocketUrl string, ) SupplierFn { @@ -53,10 +53,9 @@ func NewSupplyEventsQueryClientFn( } } -// NewSupplyBlockClientFn returns a function with constructs a BlockClient instance -// with the given nodeURL and returns a new -// depinject.Config which is supplied with the given deps and the new -// BlockClient. +// NewSupplyBlockClientFn returns a function which constructs a BlockClient instance +// with the given nodeURL and returns a new depinject.Config which is supplied with +// the given deps and the new BlockClient. func NewSupplyBlockClientFn(pocketNodeWebsocketUrl string) SupplierFn { return func( ctx context.Context, diff --git a/pkg/relayer/cmd/cmd.go b/pkg/relayer/cmd/cmd.go index 4f43c4ff2..36bb1f371 100644 --- a/pkg/relayer/cmd/cmd.go +++ b/pkg/relayer/cmd/cmd.go @@ -13,8 +13,6 @@ import ( "github.com/spf13/cobra" "github.com/pokt-network/poktroll/cmd/signals" - "github.com/pokt-network/poktroll/pkg/client/block" - eventsquery "github.com/pokt-network/poktroll/pkg/client/events_query" "github.com/pokt-network/poktroll/pkg/client/supplier" "github.com/pokt-network/poktroll/pkg/client/tx" "github.com/pokt-network/poktroll/pkg/deps/config" @@ -148,42 +146,6 @@ func getPocketNodeWebsocketUrl() (string, error) { return fmt.Sprintf("ws://%s/websocket", pocketNodeURL.Host), nil } -// newSupplyEventsQueryClientFn constructs an EventsQueryClient instance and returns -// a new depinject.Config which is supplied with the given deps and the new -// EventsQueryClient. -func newSupplyEventsQueryClientFn( - pocketNodeWebsocketUrl string, -) config.SupplierFn { - return func( - _ context.Context, - deps depinject.Config, - _ *cobra.Command, - ) (depinject.Config, error) { - eventsQueryClient := eventsquery.NewEventsQueryClient(pocketNodeWebsocketUrl) - - return depinject.Configs(deps, depinject.Supply(eventsQueryClient)), nil - } -} - -// newSupplyBlockClientFn returns a function with constructs a BlockClient instance -// with the given nodeURL and returns a new -// depinject.Config which is supplied with the given deps and the new -// BlockClient. -func newSupplyBlockClientFn(pocketNodeWebsocketUrl string) config.SupplierFn { - return func( - ctx context.Context, - deps depinject.Config, - _ *cobra.Command, - ) (depinject.Config, error) { - blockClient, err := block.NewBlockClient(ctx, deps, pocketNodeWebsocketUrl) - if err != nil { - return nil, err - } - - return depinject.Configs(deps, depinject.Supply(blockClient)), nil - } -} - // supplyMiner constructs a Miner instance and returns a new depinject.Config // which is supplied with the given deps and the new Miner. func supplyMiner(