Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/bank: Remove Context Param #6645

Merged
merged 1 commit into from
Jul 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions x/bank/client/cli/cli_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func (s *IntegrationTestSuite) TestGetBalancesCmd() {
s.Run(tc.name, func() {
buf.Reset()

cmd := cli.GetBalancesCmd(clientCtx)
cmd := cli.GetBalancesCmd()
cmd.SetErr(buf)
cmd.SetOut(buf)
cmd.SetArgs(tc.args)
Expand Down Expand Up @@ -167,7 +167,7 @@ func (s *IntegrationTestSuite) TestGetCmdQueryTotalSupply() {
s.Run(tc.name, func() {
buf.Reset()

cmd := cli.GetCmdQueryTotalSupply(clientCtx)
cmd := cli.GetCmdQueryTotalSupply()
cmd.SetErr(buf)
cmd.SetOut(buf)
cmd.SetArgs(tc.args)
Expand Down
12 changes: 7 additions & 5 deletions x/bank/client/cli/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const (
// GetQueryCmd returns the parent command for all x/bank CLi query commands. The
// provided clientCtx should have, at a minimum, a verifier, Tendermint RPC client,
// and marshaler set.
func GetQueryCmd(clientCtx client.Context) *cobra.Command {
func GetQueryCmd() *cobra.Command {
cmd := &cobra.Command{
Use: types.ModuleName,
Short: "Querying commands for the bank module",
Expand All @@ -32,14 +32,14 @@ func GetQueryCmd(clientCtx client.Context) *cobra.Command {
}

cmd.AddCommand(
GetBalancesCmd(clientCtx),
GetCmdQueryTotalSupply(clientCtx),
GetBalancesCmd(),
GetCmdQueryTotalSupply(),
)

return cmd
}

func GetBalancesCmd(clientCtx client.Context) *cobra.Command {
func GetBalancesCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "balances [address]",
Short: "Query for account balances by address",
Expand All @@ -55,6 +55,7 @@ Example:
),
Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
clientCtx := client.GetClientContextFromCmd(cmd)
clientCtx, err := client.ReadQueryCommandFlags(clientCtx, cmd.Flags())
if err != nil {
return err
Expand Down Expand Up @@ -97,7 +98,7 @@ Example:
return flags.GetCommands(cmd)[0]
}

func GetCmdQueryTotalSupply(clientCtx client.Context) *cobra.Command {
func GetCmdQueryTotalSupply() *cobra.Command {
cmd := &cobra.Command{
Use: "total",
Short: "Query the total supply of coins of the chain",
Expand All @@ -114,6 +115,7 @@ To query for the total supply of a specific coin denomination use:
),
),
RunE: func(cmd *cobra.Command, args []string) error {
clientCtx := client.GetClientContextFromCmd(cmd)
clientCtx, err := client.ReadQueryCommandFlags(clientCtx, cmd.Flags())
if err != nil {
return err
Expand Down
4 changes: 2 additions & 2 deletions x/bank/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ func (AppModuleBasic) GetTxCmd(_ client.Context) *cobra.Command {
}

// GetQueryCmd returns no root query command for the bank module.
func (AppModuleBasic) GetQueryCmd(clientCtx client.Context) *cobra.Command {
return cli.GetQueryCmd(clientCtx)
func (AppModuleBasic) GetQueryCmd(_ client.Context) *cobra.Command {
return cli.GetQueryCmd()
}

// RegisterInterfaceTypes registers interfaces and implementations of the bank module.
Expand Down