Skip to content

Commit

Permalink
chore: remove globalfee e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tbruyelle committed Aug 20, 2024
1 parent 3dd5af4 commit 161b5c7
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 125 deletions.
4 changes: 1 addition & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,6 @@ endif
docker-build-debug:
@docker build -t cosmos/atomoned-e2e -f e2e.Dockerfile .

docker-build-all: docker-build-debug docker-build-hermes

###############################################################################
### Linting ###
###############################################################################
Expand Down Expand Up @@ -275,7 +273,7 @@ test-docker-push: test-docker
@docker push ${TEST_DOCKER_REPO}:latest

.PHONY: all build-linux install format lint go-mod-cache draw-deps clean build \
docker-build-debug docker-build-hermes docker-build-all
docker-build-debug


###############################################################################
Expand Down
138 changes: 17 additions & 121 deletions tests/e2e/e2e_setup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,37 +43,27 @@ import (
)

const (
atomonedBinary = "atomoned"
txCommand = "tx"
queryCommand = "query"
keysCommand = "keys"
atomoneHomePath = "/home/nonroot/.atomone"
photonDenom = "photon"
uatomDenom = "uatom"
stakeDenom = "stake"
initBalanceStr = "110000000000stake,100000000000000000photon,100000000000000000uatom"
minGasPrice = "0.00001"
// the test globalfee in genesis is the same as minGasPrice
// global fee lower/higher than min_gas_price
initialGlobalFeeAmt = "0.00001"
lowGlobalFeesAmt = "0.000001"
highGlobalFeeAmt = "0.0001"
maxTotalBypassMinFeeMsgGasUsage = "1"
gas = 200000
govProposalBlockBuffer = 35
relayerAccountIndexHermes = 0
numberOfEvidences = 10
slashingShares int64 = 10000

proposalGlobalFeeFilename = "proposal_globalfee.json"
atomonedBinary = "atomoned"
txCommand = "tx"
queryCommand = "query"
keysCommand = "keys"
atomoneHomePath = "/home/nonroot/.atomone"
photonDenom = "photon"
uatomDenom = "uatom"
stakeDenom = "stake"
initBalanceStr = "110000000000stake,100000000000000000photon,100000000000000000uatom"
minGasPrice = "0.00001"
gas = 200000
govProposalBlockBuffer = 35
relayerAccountIndexHermes = 0
numberOfEvidences = 10
slashingShares int64 = 10000

proposalBypassMsgFilename = "proposal_bypass_msg.json"
proposalMaxTotalBypassFilename = "proposal_max_total_bypass.json"
proposalCommunitySpendFilename = "proposal_community_spend.json"
proposalLSMParamUpdateFilename = "proposal_lsm_param_update.json"

// proposalAddConsumerChainFilename = "proposal_add_consumer.json"
// proposalRemoveConsumerChainFilename = "proposal_remove_consumer.json"

// hermesBinary = "hermes"
// hermesConfigWithGasPrices = "/root/.hermes/config.toml"
// hermesConfigNoGasPrices = "/root/.hermes/config-zero.toml"
Expand Down Expand Up @@ -207,7 +197,7 @@ func (s *IntegrationTestSuite) initNodes(c *chain) {
}

s.Require().NoError(
modifyGenesis(val0ConfigDir, "", initBalanceStr, addrAll, initialGlobalFeeAmt+uatomDenom, uatomDenom),
modifyGenesis(val0ConfigDir, "", initBalanceStr, addrAll, uatomDenom),
)
// copy the genesis file to the remaining validators
for _, val := range c.validators[1:] {
Expand Down Expand Up @@ -590,100 +580,6 @@ func noRestart(config *docker.HostConfig) {
}
}

func (s *IntegrationTestSuite) writeGovParamChangeProposalGlobalFees(c *chain, coins sdk.DecCoins) {
type ParamInfo struct {
Subspace string `json:"subspace"`
Key string `json:"key"`
Value sdk.DecCoins `json:"value"`
}

type ParamChangeMessage struct {
Title string `json:"title"`
Description string `json:"description"`
Changes []ParamInfo `json:"changes"`
Deposit string `json:"deposit"`
}

paramChangeProposalBody, err := json.MarshalIndent(ParamChangeMessage{
Title: "global fee test",
Description: "global fee change",
Changes: []ParamInfo{
{
Subspace: "globalfee",
Key: "MinimumGasPricesParam",
Value: coins,
},
},
Deposit: "1000uatom",
}, "", " ")
s.Require().NoError(err)

err = writeFile(filepath.Join(c.validators[0].configDir(), "config", proposalGlobalFeeFilename), paramChangeProposalBody)
s.Require().NoError(err)
}

func (s *IntegrationTestSuite) writeGovParamChangeProposalBypassMsgs(c *chain, msgs []string) {
type ParamInfo struct {
Subspace string `json:"subspace"`
Key string `json:"key"`
Value []string `json:"value"`
}

type ParamChangeMessage struct {
Title string `json:"title"`
Description string `json:"description"`
Changes []ParamInfo `json:"changes"`
Deposit string `json:"deposit"`
}
paramChangeProposalBody, err := json.MarshalIndent(ParamChangeMessage{
Title: "ChangeProposalBypassMsgs",
Description: "global fee change",
Changes: []ParamInfo{
{
Subspace: "globalfee",
Key: "BypassMinFeeMsgTypes",
Value: msgs,
},
},
Deposit: "1000uatom",
}, "", " ")
s.Require().NoError(err)

err = writeFile(filepath.Join(c.validators[0].configDir(), "config", proposalBypassMsgFilename), paramChangeProposalBody)
s.Require().NoError(err)
}

func (s *IntegrationTestSuite) writeGovParamChangeProposalMaxTotalBypass(c *chain, gas uint64) {
type ParamInfo struct {
Subspace string `json:"subspace"`
Key string `json:"key"`
Value string `json:"value"`
}

type ParamChangeMessage struct {
Title string `json:"title"`
Description string `json:"description"`
Changes []ParamInfo `json:"changes"`
Deposit string `json:"deposit"`
}
paramChangeProposalBody, err := json.MarshalIndent(ParamChangeMessage{
Title: "ChangeProposalMaxTotalBypass",
Description: "global fee change",
Changes: []ParamInfo{
{
Subspace: "globalfee",
Key: "MaxTotalBypassMinFeeMsgGasUsage",
Value: strconv.FormatInt(int64(gas), 10),
},
},
Deposit: "1000uatom",
}, "", " ")
s.Require().NoError(err)

err = writeFile(filepath.Join(c.validators[0].configDir(), "config", proposalMaxTotalBypassFilename), paramChangeProposalBody)
s.Require().NoError(err)
}

func (s *IntegrationTestSuite) writeGovCommunitySpendProposal(c *chain, amount sdk.Coin, recipient string) {
template := `
{
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func getGenDoc(path string) (*tmtypes.GenesisDoc, error) {
return doc, nil
}

func modifyGenesis(path, moniker, amountStr string, addrAll []sdk.AccAddress, globfees string, denom string) error {
func modifyGenesis(path, moniker, amountStr string, addrAll []sdk.AccAddress, denom string) error {
serverCtx := server.NewDefaultContext()
config := serverCtx.Config
config.SetRoot(path)
Expand Down

0 comments on commit 161b5c7

Please sign in to comment.