Skip to content

Commit

Permalink
cmd/akash cleanup: use context.Client()
Browse files Browse the repository at this point in the history
  • Loading branch information
boz committed Mar 27, 2018
1 parent 3335953 commit 859bd6f
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion cmd/akash/context/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ func (ctx *context) Nonce() (uint64, error) {
nonce, err := ctx.cmd.Flags().GetUint64(constants.FlagNonce)
if err != nil || nonce == uint64(0) {
res := new(types.Account)
client := tmclient.NewHTTP(ctx.Node(), "/websocket")
client := ctx.Client()
key, _ := ctx.Key()
queryPath := state.AccountPath + key.Address.String()
result, err := client.ABCIQuery(queryPath, nil)
Expand Down
3 changes: 1 addition & 2 deletions cmd/akash/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"github.com/ovrclk/akash/types/base"
"github.com/spf13/cobra"
"github.com/tendermint/go-wire/data"
tmclient "github.com/tendermint/tendermint/rpc/client"
)

func providerCommand() *cobra.Command {
Expand Down Expand Up @@ -109,7 +108,7 @@ func doCreateProviderCommand(ctx context.Context, cmd *cobra.Command, args []str
return err
}

client := tmclient.NewHTTP(ctx.Node(), "/websocket")
client := ctx.Client()

result, err := client.BroadcastTxCommit(tx)
if err != nil {
Expand Down
3 changes: 1 addition & 2 deletions cmd/akash/query/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"github.com/gogo/protobuf/proto"
"github.com/ovrclk/akash/cmd/akash/context"
"github.com/spf13/cobra"
tmclient "github.com/tendermint/tendermint/rpc/client"
core_types "github.com/tendermint/tendermint/rpc/core/types"
)

Expand All @@ -34,7 +33,7 @@ func QueryCommand() *cobra.Command {
}

func Query(ctx context.Context, path string) (*core_types.ResultABCIQuery, error) {
client := tmclient.NewHTTP(ctx.Node(), "/websocket")
client := ctx.Client()
result, err := client.ABCIQuery(path, nil)
if err != nil {
return result, err
Expand Down
3 changes: 1 addition & 2 deletions cmd/akash/send.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
"github.com/ovrclk/akash/types"
"github.com/ovrclk/akash/types/base"
"github.com/spf13/cobra"
tmclient "github.com/tendermint/tendermint/rpc/client"
)

func sendCommand() *cobra.Command {
Expand Down Expand Up @@ -57,7 +56,7 @@ func doSendCommand(ctx context.Context, cmd *cobra.Command, args []string) error
return err
}

client := tmclient.NewHTTP(ctx.Node(), "/websocket")
client := ctx.Client()

result, err := client.BroadcastTxCommit(tx)
if err != nil {
Expand Down
3 changes: 1 addition & 2 deletions cmd/akash/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (

"github.com/ovrclk/akash/cmd/akash/context"
"github.com/spf13/cobra"
tmclient "github.com/tendermint/tendermint/rpc/client"
)

func statusCommand() *cobra.Command {
Expand All @@ -21,7 +20,7 @@ func statusCommand() *cobra.Command {
}

func doStatusCommand(ctx context.Context, cmd *cobra.Command, args []string) error {
client := tmclient.NewHTTP(ctx.Node(), "/websocket")
client := ctx.Client()

result, err := client.Status()
if err != nil {
Expand Down

0 comments on commit 859bd6f

Please sign in to comment.