Skip to content

Commit

Permalink
Fixed connect command
Browse files Browse the repository at this point in the history
  • Loading branch information
bsrinivas8687 committed Jul 15, 2023
1 parent f193c06 commit 41a70de
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
14 changes: 7 additions & 7 deletions cmd/connect.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
),
)
Expand Down Expand Up @@ -217,7 +217,7 @@ func ConnectCmd() *cobra.Command {
messages,
sessiontypes.NewMsgEndRequest(
ctx.FromAddress,
session.Id,
session.ID,
0,
),
)
Expand Down Expand Up @@ -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
}
Expand All @@ -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
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())

Expand Down

0 comments on commit 41a70de

Please sign in to comment.