Require proto.Message in client.Context.PrintOutput (#6999)
* Enable proto JSON json for cli tx & query * WIP on tests * Test fixes, cleanup * Cleanup * Address review comments * Update client/context.go Co-authored-by: Anil Kumar Kammari <anil@vitwit.com> * Fixes Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> Co-authored-by: Anil Kumar Kammari <anil@vitwit.com>
This commit is contained in:
co-authored by
Anil Kumar Kammari
Federico Kunze
parent
20c80cfd44
commit
7de8ef75b3
@@ -114,12 +114,12 @@ func (s *IntegrationTestSuite) TestGetCmdQueryInflation() {
|
||||
{
|
||||
"json output",
|
||||
[]string{fmt.Sprintf("--%s=1", flags.FlagHeight), fmt.Sprintf("--%s=json", tmcli.OutputFlag)},
|
||||
`"1.000000000000000000"`,
|
||||
`1.000000000000000000`,
|
||||
},
|
||||
{
|
||||
"text output",
|
||||
[]string{fmt.Sprintf("--%s=1", flags.FlagHeight), fmt.Sprintf("--%s=text", tmcli.OutputFlag)},
|
||||
`"1.000000000000000000"`,
|
||||
`1.000000000000000000`,
|
||||
},
|
||||
}
|
||||
|
||||
@@ -155,12 +155,12 @@ func (s *IntegrationTestSuite) TestGetCmdQueryAnnualProvisions() {
|
||||
{
|
||||
"json output",
|
||||
[]string{fmt.Sprintf("--%s=1", flags.FlagHeight), fmt.Sprintf("--%s=json", tmcli.OutputFlag)},
|
||||
`"500000000.000000000000000000"`,
|
||||
`500000000.000000000000000000`,
|
||||
},
|
||||
{
|
||||
"text output",
|
||||
[]string{fmt.Sprintf("--%s=1", flags.FlagHeight), fmt.Sprintf("--%s=text", tmcli.OutputFlag)},
|
||||
`"500000000.000000000000000000"`,
|
||||
`500000000.000000000000000000`,
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package cli
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
@@ -52,7 +53,7 @@ func GetCmdQueryParams() *cobra.Command {
|
||||
return err
|
||||
}
|
||||
|
||||
return clientCtx.PrintOutput(res.GetParams())
|
||||
return clientCtx.PrintOutput(&res.Params)
|
||||
},
|
||||
}
|
||||
|
||||
@@ -84,7 +85,7 @@ func GetCmdQueryInflation() *cobra.Command {
|
||||
return err
|
||||
}
|
||||
|
||||
return clientCtx.PrintOutput(res.Inflation)
|
||||
return clientCtx.PrintString(fmt.Sprintf("%s\n", res.Inflation))
|
||||
},
|
||||
}
|
||||
|
||||
@@ -116,7 +117,7 @@ func GetCmdQueryAnnualProvisions() *cobra.Command {
|
||||
return err
|
||||
}
|
||||
|
||||
return clientCtx.PrintOutput(res.AnnualProvisions)
|
||||
return clientCtx.PrintString(fmt.Sprintf("%s\n", res.AnnualProvisions))
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user