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

[Relayminer] chore: cleanup after 177 #190

Merged
merged 2 commits into from
Nov 16, 2023
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
13 changes: 6 additions & 7 deletions pkg/deps/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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,
Expand Down
38 changes: 0 additions & 38 deletions pkg/relayer/cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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(
Expand Down