Skip to content

Commit

Permalink
Merge remote-tracking branch 'pokt/main' into issues/126/test/protocol
Browse files Browse the repository at this point in the history
* pokt/main:
  [Relayminer] chore: cleanup after 177 (#190)
  [E2E relay test] Update to #178 (#184)
  • Loading branch information
bryanchriswhite committed Nov 17, 2023
2 parents c2476a6 + dd34341 commit 91f5c25
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 45 deletions.
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

0 comments on commit 91f5c25

Please sign in to comment.