client: rename CliContext to Context (#6290)

* Refactor CliContext as Context

* Fix lint issues

* Fix goimports

* Fix gov tests

* Resolved ci-lint issues

* Add changelog

* Rename cliCtx to clientCtx

* Fix mocks and routes

* Add changelog

* Update changelog

* Apply suggestions from code review

Co-authored-by: Alessio Treglia <alessio@tendermint.com>

* merge client/rpc/ro{ot,utes}.go

* Update docs

* client/rpc: remove redundant client/rpc.RegisterRPCRoutes

* regenerate mocks

* Update ADRs

Co-authored-by: Alessio Treglia <alessio@tendermint.com>
Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This commit is contained in:
SaReN
2020-06-01 12:46:03 +00:00
committed by GitHub
co-authored by Alessio Treglia Federico Kunze mergify[bot]
parent 654b2fdd10
commit 39f53ac22f
158 changed files with 1810 additions and 1830 deletions
+9 -10
View File
@@ -6,7 +6,6 @@ import (
"github.com/spf13/cobra"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/context"
"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
@@ -42,10 +41,10 @@ func GetCmdQueryParams(cdc *codec.Codec) *cobra.Command {
Short: "Query the current minting parameters",
Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error {
cliCtx := context.NewCLIContext().WithCodec(cdc)
clientCtx := client.NewContext().WithCodec(cdc)
route := fmt.Sprintf("custom/%s/%s", types.QuerierRoute, types.QueryParameters)
res, _, err := cliCtx.QueryWithData(route, nil)
res, _, err := clientCtx.QueryWithData(route, nil)
if err != nil {
return err
}
@@ -55,7 +54,7 @@ func GetCmdQueryParams(cdc *codec.Codec) *cobra.Command {
return err
}
return cliCtx.PrintOutput(params)
return clientCtx.PrintOutput(params)
},
}
}
@@ -68,10 +67,10 @@ func GetCmdQueryInflation(cdc *codec.Codec) *cobra.Command {
Short: "Query the current minting inflation value",
Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error {
cliCtx := context.NewCLIContext().WithCodec(cdc)
clientCtx := client.NewContext().WithCodec(cdc)
route := fmt.Sprintf("custom/%s/%s", types.QuerierRoute, types.QueryInflation)
res, _, err := cliCtx.QueryWithData(route, nil)
res, _, err := clientCtx.QueryWithData(route, nil)
if err != nil {
return err
}
@@ -81,7 +80,7 @@ func GetCmdQueryInflation(cdc *codec.Codec) *cobra.Command {
return err
}
return cliCtx.PrintOutput(inflation)
return clientCtx.PrintOutput(inflation)
},
}
}
@@ -94,10 +93,10 @@ func GetCmdQueryAnnualProvisions(cdc *codec.Codec) *cobra.Command {
Short: "Query the current minting annual provisions value",
Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error {
cliCtx := context.NewCLIContext().WithCodec(cdc)
clientCtx := client.NewContext().WithCodec(cdc)
route := fmt.Sprintf("custom/%s/%s", types.QuerierRoute, types.QueryAnnualProvisions)
res, _, err := cliCtx.QueryWithData(route, nil)
res, _, err := clientCtx.QueryWithData(route, nil)
if err != nil {
return err
}
@@ -107,7 +106,7 @@ func GetCmdQueryAnnualProvisions(cdc *codec.Codec) *cobra.Command {
return err
}
return cliCtx.PrintOutput(inflation)
return clientCtx.PrintOutput(inflation)
},
}
}