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

chore: bump api to v0.0.56 with updated client options #209

Merged
merged 1 commit into from
Mar 7, 2024
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
chore: bump api to v0.0.56 with updated client options
Signed-off-by: Artur Troian <[email protected]>
  • Loading branch information
troian committed Mar 7, 2024
commit 519ffadbe89d76944d57bd228f288fbff8d702d1
11 changes: 7 additions & 4 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import (
"fmt"
"reflect"

"github.com/spf13/pflag"
"golang.org/x/net/context"

sdkclient "github.com/cosmos/cosmos-sdk/client"

aclient "github.com/akash-network/akash-api/go/node/client"
cltypes "github.com/akash-network/akash-api/go/node/client/types"
"github.com/akash-network/akash-api/go/node/client/v1beta2"
)

Expand All @@ -37,17 +37,20 @@ func DiscoverQueryClient(ctx context.Context, cctx sdkclient.Context) (v1beta2.Q
return cl, nil
}

func DiscoverClient(ctx context.Context, cctx sdkclient.Context, flags *pflag.FlagSet) (v1beta2.Client, error) {
func DiscoverClient(ctx context.Context, cctx sdkclient.Context, opts ...cltypes.ClientOption) (v1beta2.Client, error) {
var cl v1beta2.Client
err := aclient.DiscoverClient(ctx, cctx, flags, func(i interface{}) error {

setupFn := func(i interface{}) error {
var valid bool

if cl, valid = i.(v1beta2.Client); !valid {
return fmt.Errorf("%w: expected %s, actual %s", ErrInvalidClient, reflect.TypeOf(cl), reflect.TypeOf(i))
}

return nil
})
}

err := aclient.DiscoverClient(ctx, cctx, setupFn, opts...)

if err != nil {
return nil, err
Expand Down
9 changes: 8 additions & 1 deletion cmd/provider-services/cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"strings"
"time"

cltypes "github.com/akash-network/akash-api/go/node/client/types"
sdkclient "github.com/cosmos/cosmos-sdk/client"
"github.com/pkg/errors"
"github.com/shopspring/decimal"
Expand Down Expand Up @@ -542,7 +543,13 @@ func doRunCmd(ctx context.Context, cmd *cobra.Command, _ []string) error {
}

cctx = cctx.WithSkipConfirmation(true)
cl, err := client.DiscoverClient(ctx, cctx, cmd.Flags())

opts, err := cltypes.ClientOptionsFromFlags(cmd.Flags())
if err != nil {
return err
}

cl, err := client.DiscoverClient(ctx, cctx, opts...)
if err != nil {
return err
}
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ module github.com/akash-network/provider
go 1.21

require (
github.com/akash-network/akash-api v0.0.55
github.com/akash-network/node v0.30.3
github.com/akash-network/akash-api v0.0.56
github.com/akash-network/node v0.31.0-rc0
github.com/avast/retry-go/v4 v4.5.0
github.com/blang/semver/v4 v4.0.0
github.com/boz/go-lifecycle v0.1.1
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -197,16 +197,16 @@ github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia
github.com/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4RqaHDIsdSBg7lM=
github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY=
github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw=
github.com/akash-network/akash-api v0.0.55 h1:koRFImeVbEggkWGEQ97U+qHuryQ/LRDg5yHqnGmMXcg=
github.com/akash-network/akash-api v0.0.55/go.mod h1:pNr61L4+0sheol7ZK0HjgK3rxpIAbYBGq1w1oH4B0+M=
github.com/akash-network/akash-api v0.0.56 h1:dUiDR7DXeMXgh9xyxCik4gznTsjSJhi8Pq3iPcZoqSc=
github.com/akash-network/akash-api v0.0.56/go.mod h1:pNr61L4+0sheol7ZK0HjgK3rxpIAbYBGq1w1oH4B0+M=
github.com/akash-network/cometbft v0.34.27-akash h1:V1dApDOr8Ee7BJzYyQ7Z9VBtrAul4+baMeA6C49dje0=
github.com/akash-network/cometbft v0.34.27-akash/go.mod h1:BcCbhKv7ieM0KEddnYXvQZR+pZykTKReJJYf7YC7qhw=
github.com/akash-network/ledger-go v0.14.3 h1:LCEFkTfgGA2xFMN2CtiKvXKE7dh0QSM77PJHCpSkaAo=
github.com/akash-network/ledger-go v0.14.3/go.mod h1:NfsjfFvno9Kaq6mfpsKz4sqjnAVVEsVsnBJfKB4ueAs=
github.com/akash-network/ledger-go/cosmos v0.14.4 h1:h3WiXmoKKs9wkj1LHcJ12cLjXXg6nG1fp+UQ5+wu/+o=
github.com/akash-network/ledger-go/cosmos v0.14.4/go.mod h1:SjAfheQTE4rWk0ir+wjbOWxwj8nc8E4AZ08NdsvYG24=
github.com/akash-network/node v0.30.3 h1:mWfbVgcB+yivfdjYlG4Px3OTNqU9kydpDV7U5RH2VZ0=
github.com/akash-network/node v0.30.3/go.mod h1:9RTpVtpqxzWb17YoeVAXcC+j5EIPG1U+cR/WyqvEe/M=
github.com/akash-network/node v0.31.0-rc0 h1:Ls54ebvbHvBGoWEj1M6VatZmBHgUl2XkZL2XE4S0XZQ=
github.com/akash-network/node v0.31.0-rc0/go.mod h1:wGWR5LewA1nq+O/Sib5kYfBCLVCAqS83oWZ/RuHGYDY=
github.com/alecthomas/participle/v2 v2.0.0-alpha7 h1:cK4vjj0VSgb3lN1nuKA5F7dw+1s1pWBe5bx7nNCnN+c=
github.com/alecthomas/participle/v2 v2.0.0-alpha7/go.mod h1:NumScqsC42o9x+dGj8/YqsIfhrIQjFEOFovxotbBirA=
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
Expand Down
Loading