@@ -42,7 +42,7 @@ func CmdQueryParams() *cobra.Command {
42
42
}
43
43
44
44
queryClient := types .NewQueryClient (clientCtx )
45
- res , err := queryClient .Params (clientCtx . CmdContext , & types.ParamsRequest {})
45
+ res , err := queryClient .Params (cmd . Context () , & types.ParamsRequest {})
46
46
if err != nil {
47
47
return err
48
48
}
@@ -67,7 +67,7 @@ func CmdQueryMarketMap() *cobra.Command {
67
67
}
68
68
69
69
queryClient := types .NewQueryClient (clientCtx )
70
- res , err := queryClient .MarketMap (clientCtx . CmdContext , & types.MarketMapRequest {})
70
+ res , err := queryClient .MarketMap (cmd . Context () , & types.MarketMapRequest {})
71
71
if err != nil {
72
72
return err
73
73
}
@@ -82,22 +82,19 @@ func CmdQueryMarketMap() *cobra.Command {
82
82
83
83
func CmdQueryMarket () * cobra.Command {
84
84
cmd := & cobra.Command {
85
- Use : "market" ,
85
+ Use : "market [base] [quote] " ,
86
86
Short : "Query the a market using the given currency pair" ,
87
- Args : cobra .ExactArgs (1 ),
87
+ Args : cobra .ExactArgs (2 ),
88
88
RunE : func (cmd * cobra.Command , args []string ) error {
89
89
clientCtx , err := client .GetClientQueryContext (cmd )
90
90
if err != nil {
91
91
return err
92
92
}
93
93
94
- cp , err := slinkytypes .CurrencyPairFromString (args [0 ])
95
- if err != nil {
96
- return err
97
- }
94
+ cp := slinkytypes .NewCurrencyPair (args [0 ], args [1 ])
98
95
99
96
queryClient := types .NewQueryClient (clientCtx )
100
- res , err := queryClient .Market (clientCtx . CmdContext , & types.MarketRequest {
97
+ res , err := queryClient .Market (cmd . Context () , & types.MarketRequest {
101
98
CurrencyPair : cp ,
102
99
})
103
100
if err != nil {
@@ -124,7 +121,7 @@ func CmdQueryLastUpdated() *cobra.Command {
124
121
}
125
122
126
123
queryClient := types .NewQueryClient (clientCtx )
127
- res , err := queryClient .LastUpdated (clientCtx . CmdContext , & types.LastUpdatedRequest {})
124
+ res , err := queryClient .LastUpdated (cmd . Context () , & types.LastUpdatedRequest {})
128
125
if err != nil {
129
126
return err
130
127
}
0 commit comments