Skip to content

Commit

Permalink
use module name as part of gaiad cli command
Browse files Browse the repository at this point in the history
  • Loading branch information
Pantani committed Oct 4, 2022
1 parent 2f8fa1a commit 52f9743
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 50 deletions.
94 changes: 50 additions & 44 deletions tests/e2e/e2e_exec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ import (
"cosmossdk.io/math"
"github.com/cosmos/cosmos-sdk/client/flags"
sdk "github.com/cosmos/cosmos-sdk/types"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
distributiontypes "github.com/cosmos/cosmos-sdk/x/distribution/types"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
grouptypes "github.com/cosmos/cosmos-sdk/x/group"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
icamauth "github.com/cosmos/gaia/v8/x/icamauth/types"
"github.com/ory/dockertest/v3/docker"
)

Expand All @@ -23,8 +29,8 @@ func (s *IntegrationTestSuite) execBankSend(c *chain, valIdx int, from, to, amt,

gaiaCommand := []string{
gaiadBinary,
"tx",
"bank",
txCommand,
banktypes.ModuleName,
"send",
from,
to,
Expand All @@ -46,8 +52,8 @@ func (s *IntegrationTestSuite) execWithdrawAllRewards(c *chain, valIdx int, paye

gaiaCommand := []string{
gaiadBinary,
"tx",
"distribution",
txCommand,
distributiontypes.ModuleName,
"withdraw-all-rewards",
fmt.Sprintf("--%s=%s", flags.FlagFrom, payee),
fmt.Sprintf("--%s=%s", flags.FlagGasPrices, fees),
Expand All @@ -68,8 +74,8 @@ func (s *IntegrationTestSuite) execDistributionFundCommunityPool(c *chain, valId

gaiaCommand := []string{
gaiadBinary,
"tx",
"distribution",
txCommand,
distributiontypes.ModuleName,
"fund-community-pool",
amt,
fmt.Sprintf("--%s=%s", flags.FlagFrom, from),
Expand All @@ -92,8 +98,8 @@ func (s *IntegrationTestSuite) execGovSubmitLegacyGovProposal(c *chain, valIdx i

gaiaCommand := []string{
gaiadBinary,
"tx",
"gov",
txCommand,
govtypes.ModuleName,
"submit-legacy-proposal",
govProposalSubType,
govProposalPath,
Expand All @@ -117,8 +123,8 @@ func (s *IntegrationTestSuite) execGovDepositProposal(c *chain, valIdx int, subm

gaiaCommand := []string{
gaiadBinary,
"tx",
"gov",
txCommand,
govtypes.ModuleName,
"deposit",
fmt.Sprintf("%d", proposalId),
amount,
Expand All @@ -142,8 +148,8 @@ func (s *IntegrationTestSuite) execGovVoteProposal(c *chain, valIdx int, submitt

gaiaCommand := []string{
gaiadBinary,
"tx",
"gov",
txCommand,
govtypes.ModuleName,
"vote",
fmt.Sprintf("%d", proposalId),
vote,
Expand All @@ -167,8 +173,8 @@ func (s *IntegrationTestSuite) execGovWeightedVoteProposal(c *chain, valIdx int,

gaiaCommand := []string{
gaiadBinary,
"tx",
"gov",
txCommand,
govtypes.ModuleName,
"weighted-vote",
fmt.Sprintf("%d", proposalId),
vote,
Expand All @@ -192,8 +198,8 @@ func (s *IntegrationTestSuite) execGovSubmitProposal(c *chain, valIdx int, submi

gaiaCommand := []string{
gaiadBinary,
"tx",
"gov",
txCommand,
govtypes.ModuleName,
"submit-proposal",
govProposalPath,
fmt.Sprintf("--%s=%s", flags.FlagFrom, submitterAddr),
Expand All @@ -216,8 +222,8 @@ func (s *IntegrationTestSuite) execCreateGroup(c *chain, valIdx int, adminAddr,

gaiaCommand := []string{
gaiadBinary,
"tx",
"group",
txCommand,
grouptypes.ModuleName,
"create-group",
adminAddr,
metadata,
Expand All @@ -241,8 +247,8 @@ func (s *IntegrationTestSuite) execUpdateGroupMembers(c *chain, valIdx int, admi

gaiaCommand := []string{
gaiadBinary,
"tx",
"group",
txCommand,
grouptypes.ModuleName,
"update-group-members",
adminAddr,
groupId,
Expand All @@ -266,8 +272,8 @@ func (s *IntegrationTestSuite) executeCreateGroupPolicy(c *chain, valIdx int, ad

gaiaCommand := []string{
gaiadBinary,
"tx",
"group",
txCommand,
grouptypes.ModuleName,
"create-group-policy",
adminAddr,
groupId,
Expand All @@ -292,8 +298,8 @@ func (s *IntegrationTestSuite) executeSubmitGroupProposal(c *chain, valIdx int,

gaiaCommand := []string{
gaiadBinary,
"tx",
"group",
txCommand,
grouptypes.ModuleName,
"submit-proposal",
proposalPath,
fmt.Sprintf("--%s=%s", flags.FlagGasPrices, fees),
Expand All @@ -316,8 +322,8 @@ func (s *IntegrationTestSuite) executeVoteGroupProposal(c *chain, valIdx int, pr

gaiaCommand := []string{
gaiadBinary,
"tx",
"group",
txCommand,
grouptypes.ModuleName,
"vote",
proposalId,
voterAddress,
Expand All @@ -342,8 +348,8 @@ func (s *IntegrationTestSuite) executeExecGroupProposal(c *chain, valIdx int, pr

gaiaCommand := []string{
gaiadBinary,
"tx",
"group",
txCommand,
grouptypes.ModuleName,
"exec",
proposalId,
fmt.Sprintf("--%s=%s", flags.FlagFrom, proposerAddress),
Expand All @@ -366,8 +372,8 @@ func (s *IntegrationTestSuite) executeUpdateGroupAdmin(c *chain, valIdx int, adm

gaiaCommand := []string{
gaiadBinary,
"tx",
"group",
txCommand,
grouptypes.ModuleName,
"update-group-admin",
admin,
groupId,
Expand All @@ -389,7 +395,7 @@ func (s *IntegrationTestSuite) executeGKeysAddCommand(c *chain, valIdx int, name

gaiaCommand := []string{
gaiadBinary,
"keys",
keysCommand,
"add",
name,
fmt.Sprintf("--%s=%s", flags.FlagHome, home),
Expand All @@ -414,7 +420,7 @@ func (s *IntegrationTestSuite) executeKeysList(c *chain, valIdx int, home string

gaiaCommand := []string{
gaiadBinary,
"keys",
keysCommand,
"list",
"--keyring-backend=test",
fmt.Sprintf("--%s=%s", flags.FlagHome, home),
Expand All @@ -434,8 +440,8 @@ func (s *IntegrationTestSuite) executeDelegate(c *chain, valIdx int, amount, val

gaiaCommand := []string{
gaiadBinary,
"tx",
"staking",
txCommand,
stakingtypes.ModuleName,
"delegate",
valOperAddress,
amount,
Expand All @@ -462,8 +468,8 @@ func (s *IntegrationTestSuite) executeRedelegate(c *chain, valIdx int, amount, o

gaiaCommand := []string{
gaiadBinary,
"tx",
"staking",
txCommand,
stakingtypes.ModuleName,
"redelegate",
originalValOperAddress,
newValOperAddress,
Expand Down Expand Up @@ -534,8 +540,8 @@ func (s *IntegrationTestSuite) execSetWithdrawAddress(
s.T().Logf("Setting distribution withdrawal address on chain %s for %s to %s", c.id, delegatorAddress, newWithdrawalAddress)
gaiaCommand := []string{
gaiadBinary,
"tx",
"distribution",
txCommand,
distributiontypes.ModuleName,
"set-withdraw-addr",
newWithdrawalAddress,
fmt.Sprintf("--%s=%s", flags.FlagFrom, delegatorAddress),
Expand Down Expand Up @@ -564,8 +570,8 @@ func (s *IntegrationTestSuite) execWithdrawReward(
s.T().Logf("Withdrawing distribution rewards on chain %s for delegator %s from %s validator", c.id, delegatorAddress, validatorAddress)
gaiaCommand := []string{
gaiadBinary,
"tx",
"distribution",
txCommand,
distributiontypes.ModuleName,
"withdraw-rewards",
validatorAddress,
fmt.Sprintf("--%s=%s", flags.FlagFrom, delegatorAddress),
Expand Down Expand Up @@ -593,8 +599,8 @@ func (s *IntegrationTestSuite) submitICAtx(owner, connectionID, txJsonPath strin

submitTX := []string{
gaiadBinary,
"tx",
"icamauth",
txCommand,
icamauth.ModuleName,
"submit",
txJsonPath,
fmt.Sprintf("--%s=%s", flags.FlagFrom, owner),
Expand Down Expand Up @@ -622,8 +628,8 @@ func (s *IntegrationTestSuite) registerICA(owner, connectionID string) {

registerICAcmd := []string{
gaiadBinary,
"tx",
"icamauth",
txCommand,
icamauth.ModuleName,
"register",
fmt.Sprintf("--%s=%s", flags.FlagFrom, owner),
fmt.Sprintf("--%s=%s", "connection-id", connectionID),
Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/e2e_ibc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ func (s *IntegrationTestSuite) sendIBC(c *chain, valIdx int, sender, recipient,

ibcCmd := []string{
gaiadBinary,
"tx",
txCommand,
"ibc-transfer",
"transfer",
"transfer",
Expand Down Expand Up @@ -199,7 +199,7 @@ func (s *IntegrationTestSuite) createChannel() {
User: "root",
Cmd: []string{
"hermes",
"tx",
txCommand,
"chan-open-init",
"--dst-chain",
s.chainA.id,
Expand Down
7 changes: 4 additions & 3 deletions tests/e2e/e2e_ica_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"cosmossdk.io/math"
"github.com/cosmos/cosmos-sdk/client/flags"
sdk "github.com/cosmos/cosmos-sdk/types"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
)

// TestICARegister must run before any other
Expand Down Expand Up @@ -93,8 +94,8 @@ func (s *IntegrationTestSuite) TestICA_2_BankSend() {
sendamt := sdk.NewCoin(uatomDenom, math.NewInt(100000))
txCmd := []string{
gaiadBinary,
"tx",
"bank",
txCommand,
banktypes.ModuleName,
"send",
ica,
receiver,
Expand Down Expand Up @@ -125,7 +126,7 @@ func (s *IntegrationTestSuite) TestICA_2_BankSend() {
sendIBCamt := math.NewInt(10)
icaIBCsendCmd := []string{
gaiadBinary,
"tx",
txCommand,
"ibc-transfer",
"transfer",
"transfer",
Expand Down
4 changes: 3 additions & 1 deletion tests/e2e/e2e_setup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types"
gov "github.com/cosmos/cosmos-sdk/x/gov/types"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1"
"github.com/cosmos/cosmos-sdk/x/group"
"github.com/cosmos/cosmos-sdk/x/group"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
"github.com/cosmos/gaia/v8/app/params"
ibcclienttypes "github.com/cosmos/ibc-go/v5/modules/core/02-client/types"
Expand All @@ -41,6 +41,8 @@ import (

const (
gaiadBinary = "gaiad"
txCommand = "tx"
keysCommand = "keys"
gaiaHomePath = "/home/nonroot/.gaia"
photonDenom = "photon"
uatomDenom = "uatom"
Expand Down

0 comments on commit 52f9743

Please sign in to comment.