From 41a70de4e86f4f169f9718795c7723a2eca1924d Mon Sep 17 00:00:00 2001 From: Srinivas Baride Date: Sat, 15 Jul 2023 20:55:30 +0530 Subject: [PATCH] Fixed connect command --- cmd/connect.go | 14 +++++++------- cmd/query.go | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/cmd/connect.go b/cmd/connect.go index 8d9d53a..e162869 100644 --- a/cmd/connect.go +++ b/cmd/connect.go @@ -83,13 +83,13 @@ func queryNode(qsc nodetypes.QueryServiceClient, address hubtypes.NodeAddress) ( func queryActiveSession(qsc sessiontypes.QueryServiceClient, address sdk.AccAddress) (*sessiontypes.Session, error) { var ( - result, err = qsc.QuerySessionsForAddress( + result, err = qsc.QuerySessionsForAccount( context.Background(), - sessiontypes.NewQuerySessionsForAddressRequest( + sessiontypes.NewQuerySessionsForAccountRequest( address, - hubtypes.StatusActive, &query.PageRequest{ - Limit: 1, + Limit: 1, + Reverse: true, }, ), ) @@ -217,7 +217,7 @@ func ConnectCmd() *cobra.Command { messages, sessiontypes.NewMsgEndRequest( ctx.FromAddress, - session.Id, + session.ID, 0, ), ) @@ -268,7 +268,7 @@ func ConnectCmd() *cobra.Command { return fmt.Errorf("invalid node type %d", nodeType) } - signature, _, err := ctx.Keyring.Sign(ctx.From, sdk.Uint64ToBigEndian(session.Id)) + signature, _, err := ctx.Keyring.Sign(ctx.From, sdk.Uint64ToBigEndian(session.ID)) if err != nil { return err } @@ -283,7 +283,7 @@ func ConnectCmd() *cobra.Command { return err } - endpoint, err := url.JoinPath(node.RemoteURL, fmt.Sprintf("/accounts/%s/sessions/%d", ctx.FromAddress, session.Id)) + endpoint, err := url.JoinPath(node.RemoteURL, fmt.Sprintf("/accounts/%s/sessions/%d", ctx.FromAddress, session.ID)) if err != nil { return err } diff --git a/cmd/query.go b/cmd/query.go index b933f90..e004319 100644 --- a/cmd/query.go +++ b/cmd/query.go @@ -32,8 +32,8 @@ func QueryCommand() *cobra.Command { cmd.AddCommand(plancmd.QueryPlans()) cmd.AddCommand(subscriptioncmd.QuerySubscription()) cmd.AddCommand(subscriptioncmd.QuerySubscriptions()) - cmd.AddCommand(subscriptioncmd.QueryQuota()) - cmd.AddCommand(subscriptioncmd.QueryQuotas()) + cmd.AddCommand(subscriptioncmd.QueryAllocation()) + cmd.AddCommand(subscriptioncmd.QueryAllocations()) cmd.AddCommand(sessioncmd.QuerySession()) cmd.AddCommand(sessioncmd.QuerySessions())