Skip to content

Commit

Permalink
remove prefix from cli/ ref tests (#2234)
Browse files Browse the repository at this point in the history
  • Loading branch information
pysel authored Sep 8, 2023
1 parent 3b6408e commit d78960b
Show file tree
Hide file tree
Showing 14 changed files with 247 additions and 247 deletions.
66 changes: 33 additions & 33 deletions x/incentive/client/cli/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,25 +28,25 @@ func GetQueryCmd() *cobra.Command {
}

cmd.AddCommand(
GetCmdQueryParams(),
GetCmdQueryAccountBonds(),
GetCmdQueryCurrentRates(),
GetCmdQueryActualRates(),
GetCmdQueryTotalBonded(),
GetCmdQueryTotalUnbonding(),
GetCmdQueryPendingRewards(),
GetCmdQueryUpcomingIncentivePrograms(),
GetCmdQueryOngoingIncentivePrograms(),
GetCmdQueryCompletedIncentivePrograms(),
GetCmdQueryIncentiveProgram(),
QueryParams(),
QueryAccountBonds(),
QueryCurrentRates(),
QueryActualRates(),
QueryTotalBonded(),
QueryTotalUnbonding(),
QueryPendingRewards(),
QueryUpcomingIncentivePrograms(),
QueryOngoingIncentivePrograms(),
QueryCompletedIncentivePrograms(),
QueryIncentiveProgram(),
)

return cmd
}

// GetCmdQueryParams creates a Cobra command to query for the x/incentive
// QueryParams creates a Cobra command to query for the x/incentive
// module parameters.
func GetCmdQueryParams() *cobra.Command {
func QueryParams() *cobra.Command {
cmd := &cobra.Command{
Use: "params",
Args: cobra.NoArgs,
Expand All @@ -67,8 +67,8 @@ func GetCmdQueryParams() *cobra.Command {
return cmd
}

// GetCmdQueryAccountBonds creates a Cobra command to query all bonds and unbondings associated with a single account.
func GetCmdQueryAccountBonds() *cobra.Command {
// QueryAccountBonds creates a Cobra command to query all bonds and unbondings associated with a single account.
func QueryAccountBonds() *cobra.Command {
cmd := &cobra.Command{
Use: "account-bonds [address]",
Args: cobra.ExactArgs(1),
Expand All @@ -90,8 +90,8 @@ func GetCmdQueryAccountBonds() *cobra.Command {
return cmd
}

// GetCmdQueryPendingRewards creates a Cobra command to query the pending incentive rewards of a single account.
func GetCmdQueryPendingRewards() *cobra.Command {
// QueryPendingRewards creates a Cobra command to query the pending incentive rewards of a single account.
func QueryPendingRewards() *cobra.Command {
cmd := &cobra.Command{
Use: "pending-rewards [address]",
Args: cobra.ExactArgs(1),
Expand All @@ -112,9 +112,9 @@ func GetCmdQueryPendingRewards() *cobra.Command {
return cmd
}

// GetCmdQueryCurrentRates creates a Cobra command to query current annual rewards for a reference amount
// QueryCurrentRates creates a Cobra command to query current annual rewards for a reference amount
// of a given bonded uToken.
func GetCmdQueryCurrentRates() *cobra.Command {
func QueryCurrentRates() *cobra.Command {
cmd := &cobra.Command{
Use: "current-rates [denom]",
Args: cobra.RangeArgs(0, 1),
Expand All @@ -139,9 +139,9 @@ func GetCmdQueryCurrentRates() *cobra.Command {
return cmd
}

// GetCmdQueryActualRates creates a Cobra command to query current annual rewards for a reference amount
// QueryActualRates creates a Cobra command to query current annual rewards for a reference amount
// of a given bonded uToken.
func GetCmdQueryActualRates() *cobra.Command {
func QueryActualRates() *cobra.Command {
cmd := &cobra.Command{
Use: "actual-rates [denom]",
Args: cobra.RangeArgs(0, 1),
Expand All @@ -166,8 +166,8 @@ func GetCmdQueryActualRates() *cobra.Command {
return cmd
}

// GetCmdQueryTotalBonded creates a Cobra command to query bonded tokens across all users.
func GetCmdQueryTotalBonded() *cobra.Command {
// QueryTotalBonded creates a Cobra command to query bonded tokens across all users.
func QueryTotalBonded() *cobra.Command {
cmd := &cobra.Command{
Use: "total-bonded [denom]",
Args: cobra.RangeArgs(0, 1),
Expand All @@ -192,8 +192,8 @@ func GetCmdQueryTotalBonded() *cobra.Command {
return cmd
}

// GetCmdQueryTotalUnbonding creates a Cobra command to query unbonding tokens across all users.
func GetCmdQueryTotalUnbonding() *cobra.Command {
// QueryTotalUnbonding creates a Cobra command to query unbonding tokens across all users.
func QueryTotalUnbonding() *cobra.Command {
cmd := &cobra.Command{
Use: "total-unbonding [denom]",
Args: cobra.RangeArgs(0, 1),
Expand All @@ -218,9 +218,9 @@ func GetCmdQueryTotalUnbonding() *cobra.Command {
return cmd
}

// GetCmdQueryUpcomingIncentivePrograms creates a Cobra command to query for all upcoming
// QueryUpcomingIncentivePrograms creates a Cobra command to query for all upcoming
// incentive programs.
func GetCmdQueryUpcomingIncentivePrograms() *cobra.Command {
func QueryUpcomingIncentivePrograms() *cobra.Command {
cmd := &cobra.Command{
Use: "upcoming",
Args: cobra.NoArgs,
Expand All @@ -242,9 +242,9 @@ func GetCmdQueryUpcomingIncentivePrograms() *cobra.Command {
return cmd
}

// GetCmdQueryOngoingIncentivePrograms creates a Cobra command to query for all ongoing
// QueryOngoingIncentivePrograms creates a Cobra command to query for all ongoing
// incentive programs.
func GetCmdQueryOngoingIncentivePrograms() *cobra.Command {
func QueryOngoingIncentivePrograms() *cobra.Command {
cmd := &cobra.Command{
Use: "ongoing",
Args: cobra.NoArgs,
Expand All @@ -266,9 +266,9 @@ func GetCmdQueryOngoingIncentivePrograms() *cobra.Command {
return cmd
}

// GetCmdQueryCompletedIncentivePrograms creates a Cobra command to query for all completed
// QueryCompletedIncentivePrograms creates a Cobra command to query for all completed
// incentive programs.
func GetCmdQueryCompletedIncentivePrograms() *cobra.Command {
func QueryCompletedIncentivePrograms() *cobra.Command {
cmd := &cobra.Command{
Use: "completed",
Args: cobra.NoArgs,
Expand All @@ -291,9 +291,9 @@ func GetCmdQueryCompletedIncentivePrograms() *cobra.Command {
return cmd
}

// GetCmdQueryIncentiveProgram creates a Cobra command to query a single incentive program
// QueryIncentiveProgram creates a Cobra command to query a single incentive program
// by its ID.
func GetCmdQueryIncentiveProgram() *cobra.Command {
func QueryIncentiveProgram() *cobra.Command {
cmd := &cobra.Command{
Use: "program [id]",
Args: cobra.ExactArgs(1),
Expand Down
22 changes: 11 additions & 11 deletions x/incentive/client/cli/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,19 @@ func GetTxCmd() *cobra.Command {
}

cmd.AddCommand(
GetCmdClaim(),
GetCmdBond(),
GetCmdBeginUnbonding(),
GetCmdEmergencyUnbond(),
GetCmdSponsor(),
Claim(),
Bond(),
BeginUnbonding(),
EmergencyUnbond(),
Sponsor(),
)

return cmd
}

// GetCmdClaim creates a Cobra command to generate or broadcast a
// Claim creates a Cobra command to generate or broadcast a
// transaction with a MsgClaim message.
func GetCmdClaim() *cobra.Command {
func Claim() *cobra.Command {
cmd := &cobra.Command{
Use: "claim",
Args: cobra.ExactArgs(0),
Expand All @@ -59,7 +59,7 @@ func GetCmdClaim() *cobra.Command {
}

// transaction with a MsgBond message.
func GetCmdBond() *cobra.Command {
func Bond() *cobra.Command {
cmd := &cobra.Command{
Use: "bond [utokens]",
Args: cobra.ExactArgs(1),
Expand Down Expand Up @@ -87,7 +87,7 @@ func GetCmdBond() *cobra.Command {
}

// transaction with a MsgBeginUnbonding message.
func GetCmdBeginUnbonding() *cobra.Command {
func BeginUnbonding() *cobra.Command {
cmd := &cobra.Command{
Use: "begin-unbonding [utokens]",
Args: cobra.ExactArgs(1),
Expand Down Expand Up @@ -115,7 +115,7 @@ func GetCmdBeginUnbonding() *cobra.Command {
}

// transaction with a MsgEmergencyUnbond message.
func GetCmdEmergencyUnbond() *cobra.Command {
func EmergencyUnbond() *cobra.Command {
cmd := &cobra.Command{
Use: "emergency-unbond [utokens]",
Args: cobra.ExactArgs(1),
Expand Down Expand Up @@ -143,7 +143,7 @@ func GetCmdEmergencyUnbond() *cobra.Command {
}

// transaction with a MsgSponsor message.
func GetCmdSponsor() *cobra.Command {
func Sponsor() *cobra.Command {
cmd := &cobra.Command{
Use: "sponsor [program-id]",
Args: cobra.ExactArgs(1),
Expand Down
40 changes: 20 additions & 20 deletions x/incentive/client/tests/tests.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ func (s *IntegrationTests) TestInvalidQueries() {
invalidQueries := []itestsuite.TestQuery{
{
Name: "query pending rewards (invalid address)",
Command: cli.GetCmdQueryPendingRewards(),
Command: cli.QueryPendingRewards(),
Args: []string{
"xyz",
},
Expand All @@ -25,7 +25,7 @@ func (s *IntegrationTests) TestInvalidQueries() {
},
{
Name: "query current rates (not uToken)",
Command: cli.GetCmdQueryCurrentRates(),
Command: cli.QueryCurrentRates(),
Args: []string{
"uumee",
},
Expand All @@ -35,7 +35,7 @@ func (s *IntegrationTests) TestInvalidQueries() {
},
{
Name: "query actual rates (not uToken)",
Command: cli.GetCmdQueryActualRates(),
Command: cli.QueryActualRates(),
Args: []string{
"uumee",
},
Expand All @@ -54,7 +54,7 @@ func (s *IntegrationTests) TestIncentiveScenario() {
zeroQueries := []itestsuite.TestQuery{
{
Name: "query params",
Command: cli.GetCmdQueryParams(),
Command: cli.QueryParams(),
Args: []string{},
Response: &incentive.QueryParamsResponse{},
ExpectedResponse: &incentive.QueryParamsResponse{
Expand All @@ -64,7 +64,7 @@ func (s *IntegrationTests) TestIncentiveScenario() {
},
{
Name: "query upcoming incentive programs",
Command: cli.GetCmdQueryUpcomingIncentivePrograms(),
Command: cli.QueryUpcomingIncentivePrograms(),
Args: []string{},
Response: &incentive.QueryUpcomingIncentiveProgramsResponse{},
ExpectedResponse: &incentive.QueryUpcomingIncentiveProgramsResponse{
Expand All @@ -74,7 +74,7 @@ func (s *IntegrationTests) TestIncentiveScenario() {
},
{
Name: "query ongoing incentive programs",
Command: cli.GetCmdQueryUpcomingIncentivePrograms(),
Command: cli.QueryUpcomingIncentivePrograms(),
Args: []string{},
Response: &incentive.QueryOngoingIncentiveProgramsResponse{},
ExpectedResponse: &incentive.QueryOngoingIncentiveProgramsResponse{
Expand All @@ -84,7 +84,7 @@ func (s *IntegrationTests) TestIncentiveScenario() {
},
{
Name: "query completed incentive programs",
Command: cli.GetCmdQueryCompletedIncentivePrograms(),
Command: cli.QueryCompletedIncentivePrograms(),
Args: []string{},
Response: &incentive.QueryCompletedIncentiveProgramsResponse{},
ExpectedResponse: &incentive.QueryCompletedIncentiveProgramsResponse{
Expand All @@ -94,7 +94,7 @@ func (s *IntegrationTests) TestIncentiveScenario() {
},
{
Name: "query total bonded - no denom",
Command: cli.GetCmdQueryTotalBonded(),
Command: cli.QueryTotalBonded(),
Args: []string{},
Response: &incentive.QueryTotalBondedResponse{},
ExpectedResponse: &incentive.QueryTotalBondedResponse{
Expand All @@ -103,7 +103,7 @@ func (s *IntegrationTests) TestIncentiveScenario() {
},
{
Name: "query total bonded - specific denom",
Command: cli.GetCmdQueryTotalBonded(),
Command: cli.QueryTotalBonded(),
Args: []string{
"u/" + appparams.BondDenom,
},
Expand All @@ -114,7 +114,7 @@ func (s *IntegrationTests) TestIncentiveScenario() {
},
{
Name: "query total unbonding - no denom",
Command: cli.GetCmdQueryTotalUnbonding(),
Command: cli.QueryTotalUnbonding(),
Args: []string{},
Response: &incentive.QueryTotalUnbondingResponse{},
ExpectedResponse: &incentive.QueryTotalUnbondingResponse{
Expand All @@ -123,7 +123,7 @@ func (s *IntegrationTests) TestIncentiveScenario() {
},
{
Name: "query total unbonding - specific denom",
Command: cli.GetCmdQueryTotalUnbonding(),
Command: cli.QueryTotalUnbonding(),
Args: []string{
"u/" + appparams.BondDenom,
},
Expand All @@ -134,7 +134,7 @@ func (s *IntegrationTests) TestIncentiveScenario() {
},
{
Name: "query current rates (zero)",
Command: cli.GetCmdQueryCurrentRates(),
Command: cli.QueryCurrentRates(),
Args: []string{
"u/" + appparams.BondDenom,
},
Expand All @@ -147,7 +147,7 @@ func (s *IntegrationTests) TestIncentiveScenario() {
},
{
Name: "query actual rates (zero)",
Command: cli.GetCmdQueryActualRates(),
Command: cli.QueryActualRates(),
Args: []string{
"u/" + appparams.BondDenom,
},
Expand All @@ -159,7 +159,7 @@ func (s *IntegrationTests) TestIncentiveScenario() {
},
{
Name: "query pending rewards (zero)",
Command: cli.GetCmdQueryPendingRewards(),
Command: cli.QueryPendingRewards(),
Args: []string{
val.Address.String(),
},
Expand All @@ -173,7 +173,7 @@ func (s *IntegrationTests) TestIncentiveScenario() {

supplyCollateral := itestsuite.TestTransaction{
Name: "(setup) supply collateral",
Command: leveragecli.GetCmdSupplyCollateral(),
Command: leveragecli.SupplyCollateral(),
Args: []string{
"300uumee",
},
Expand All @@ -182,7 +182,7 @@ func (s *IntegrationTests) TestIncentiveScenario() {

bond := itestsuite.TestTransaction{
Name: "bond",
Command: cli.GetCmdBond(),
Command: cli.Bond(),
Args: []string{
"300u/uumee",
},
Expand All @@ -191,7 +191,7 @@ func (s *IntegrationTests) TestIncentiveScenario() {

beingUnbonding := itestsuite.TestTransaction{
Name: "begin unbonding",
Command: cli.GetCmdBeginUnbonding(),
Command: cli.BeginUnbonding(),
Args: []string{
"100u/uumee",
},
Expand All @@ -200,7 +200,7 @@ func (s *IntegrationTests) TestIncentiveScenario() {

emergencyUnbond := itestsuite.TestTransaction{
Name: "emergency unbond",
Command: cli.GetCmdEmergencyUnbond(),
Command: cli.EmergencyUnbond(),
Args: []string{
"100u/uumee",
},
Expand All @@ -209,14 +209,14 @@ func (s *IntegrationTests) TestIncentiveScenario() {

claim := itestsuite.TestTransaction{
Name: "claim",
Command: cli.GetCmdClaim(),
Command: cli.Claim(),
Args: []string{},
ExpectedErr: nil,
}

sponsor := itestsuite.TestTransaction{
Name: "sponsor (program does not exist)",
Command: cli.GetCmdSponsor(),
Command: cli.Sponsor(),
Args: []string{"1"},
ExpectedErr: sdkerrors.ErrNotFound,
}
Expand Down
Loading

0 comments on commit d78960b

Please sign in to comment.