From b8db7bc85d6a3ec1ab577d451f4c7e67b9f986d9 Mon Sep 17 00:00:00 2001
From: Philip Offtermatt
Date: Thu, 30 Nov 2023 12:49:34 +0100
Subject: [PATCH] Revert changes to e2e tests
---
tests/e2e/actions.go | 65 +++++-------------------
tests/e2e/steps_start_chains.go | 42 +++++++++++++--
tests/e2e/testnet-scripts/start-chain.sh | 1 -
3 files changed, 51 insertions(+), 57 deletions(-)
diff --git a/tests/e2e/actions.go b/tests/e2e/actions.go
index 3cb0d375e5..b95be90d12 100644
--- a/tests/e2e/actions.go
+++ b/tests/e2e/actions.go
@@ -41,8 +41,7 @@ func (tr TestConfig) sendTokens(
tr.validatorConfigs[action.From].DelAddress,
tr.validatorConfigs[action.To].DelAddress,
fmt.Sprint(action.Amount)+`stake`,
- `--gas-prices`, `0.0025stake`,
- `--gas-adjustment`, `1.5`,
+
`--chain-id`, string(tr.chainConfigs[action.Chain].ChainId),
`--home`, tr.getValidatorHome(action.Chain, action.From),
`--node`, tr.getValidatorNode(action.Chain, action.From),
@@ -205,9 +204,6 @@ func (tr TestConfig) submitTextProposal(
`--description`, action.Description,
`--deposit`, fmt.Sprint(action.Deposit)+`stake`,
`--from`, `validator`+fmt.Sprint(action.From),
- `--gas`, "auto",
- `--gas-prices`, `0.0025stake`,
- `--gas-adjustment`, `1.5`,
`--chain-id`, string(tr.chainConfigs[action.Chain].ChainId),
`--home`, tr.getValidatorHome(action.Chain, action.From),
`--node`, tr.getValidatorNode(action.Chain, action.From),
@@ -277,22 +273,16 @@ func (tr TestConfig) submitConsumerAdditionProposal(
//#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments.
// CONSUMER ADDITION PROPOSAL
- cmd := exec.Command("docker", "exec", tr.containerConfig.InstanceName, tr.chainConfigs[action.Chain].BinaryName,
+ bz, err = exec.Command("docker", "exec", tr.containerConfig.InstanceName, tr.chainConfigs[action.Chain].BinaryName,
"tx", "gov", "submit-legacy-proposal", "consumer-addition", "/temp-proposal.json",
`--from`, `validator`+fmt.Sprint(action.From),
- `--gas-prices`, `0.0025stake`,
- `--gas-adjustment`, `1.5`,
`--chain-id`, string(tr.chainConfigs[action.Chain].ChainId),
`--home`, tr.getValidatorHome(action.Chain, action.From),
- `--gas`, "auto",
+ `--gas`, `900000`,
`--node`, tr.getValidatorNode(action.Chain, action.From),
`--keyring-backend`, `test`,
`-y`,
- )
-
- log.Println(cmd)
-
- bz, err = cmd.CombinedOutput()
+ ).CombinedOutput()
if err != nil {
log.Fatal(err, "\n", string(bz))
@@ -347,12 +337,10 @@ func (tr TestConfig) submitConsumerRemovalProposal(
"tx", "gov", "submit-legacy-proposal", "consumer-removal",
"/temp-proposal.json",
`--from`, `validator`+fmt.Sprint(action.From),
- `--gas-prices`, `0.0025stake`,
- `--gas-adjustment`, `1.5`,
`--chain-id`, string(tr.chainConfigs[action.Chain].ChainId),
`--home`, tr.getValidatorHome(action.Chain, action.From),
`--node`, tr.getValidatorNode(action.Chain, action.From),
- `--gas`, "auto",
+ `--gas`, "900000",
`--keyring-backend`, `test`,
`-y`,
).CombinedOutput()
@@ -425,12 +413,10 @@ func (tr TestConfig) submitParamChangeProposal(
"tx", "gov", "submit-legacy-proposal", "param-change", "/params-proposal.json",
`--from`, `validator`+fmt.Sprint(action.From),
- `--gas-prices`, `0.0025stake`,
- `--gas-adjustment`, `1.5`,
`--chain-id`, string(tr.chainConfigs[action.Chain].ChainId),
`--home`, tr.getValidatorHome(action.Chain, action.From),
`--node`, tr.getValidatorNode(action.Chain, action.From),
- `--gas`, "auto",
+ `--gas`, "900000",
`--keyring-backend`, `test`,
`-y`,
)
@@ -468,13 +454,11 @@ func (tr *TestConfig) voteGovProposal(
fmt.Sprint(action.PropNumber), vote,
`--from`, `validator`+fmt.Sprint(val),
- `--gas-prices`, `0.0025stake`,
- `--gas-adjustment`, `1.5`,
`--chain-id`, string(tr.chainConfigs[action.Chain].ChainId),
`--home`, tr.getValidatorHome(action.Chain, val),
`--node`, tr.getValidatorNode(action.Chain, val),
`--keyring-backend`, `test`,
- `--gas`, "auto",
+ `--gas`, "900000",
`-y`,
).CombinedOutput()
if err != nil {
@@ -685,7 +669,7 @@ ccv_consumer_chain = %v
[chains.gas_price]
denom = "stake"
- price = 0.025
+ price = 0.000
[chains.trust_threshold]
denominator = "3"
@@ -968,10 +952,6 @@ func (tr TestConfig) addIbcConnectionHermes(
"--b-client", "07-tendermint-"+fmt.Sprint(action.ClientB),
)
- if verbose {
- log.Println("addIbcConnectionHermes cmd: ", cmd.String())
- }
-
cmdReader, err := cmd.StdoutPipe()
if err != nil {
log.Fatal(err)
@@ -1343,9 +1323,6 @@ func (tr TestConfig) delegateTokens(
fmt.Sprint(action.Amount)+`stake`,
`--from`, `validator`+fmt.Sprint(action.From),
- `--gas`, "auto",
- `--gas-prices`, `0.0025stake`,
- `--gas-adjustment`, `1.5`,
`--chain-id`, string(tr.chainConfigs[action.Chain].ChainId),
`--home`, tr.getValidatorHome(action.Chain, action.From),
`--node`, tr.getValidatorNode(action.Chain, action.From),
@@ -1390,12 +1367,10 @@ func (tr TestConfig) unbondTokens(
fmt.Sprint(action.Amount)+`stake`,
`--from`, `validator`+fmt.Sprint(action.Sender),
- `--gas-prices`, `0.0025stake`,
- `--gas-adjustment`, `1.5`,
`--chain-id`, string(tr.chainConfigs[action.Chain].ChainId),
`--home`, tr.getValidatorHome(action.Chain, action.Sender),
`--node`, tr.getValidatorNode(action.Chain, action.Sender),
- `--gas`, "auto",
+ `--gas`, "900000",
`--keyring-backend`, `test`,
`-y`,
)
@@ -1459,12 +1434,10 @@ func (tr TestConfig) cancelUnbondTokens(
fmt.Sprint(action.Amount)+`stake`,
fmt.Sprint(creationHeight),
`--from`, `validator`+fmt.Sprint(action.Delegator),
- `--gas-prices`, `0.0025stake`,
- `--gas-adjustment`, `1.5`,
`--chain-id`, string(tr.chainConfigs[action.Chain].ChainId),
`--home`, tr.getValidatorHome(action.Chain, action.Delegator),
`--node`, tr.getValidatorNode(action.Chain, action.Delegator),
- `--gas`, "auto",
+ `--gas`, "900000",
`--keyring-backend`, `test`,
`-o`, `json`,
`-y`,
@@ -1514,13 +1487,11 @@ func (tr TestConfig) redelegateTokens(action redelegateTokensAction, verbose boo
redelegateDst,
fmt.Sprint(action.Amount)+`stake`,
`--from`, `validator`+fmt.Sprint(action.TxSender),
- `--gas-prices`, `0.0025stake`,
- `--gas-adjustment`, `1.5`,
`--chain-id`, string(tr.chainConfigs[action.Chain].ChainId),
`--home`, tr.getValidatorHome(action.Chain, action.TxSender),
`--node`, tr.getValidatorNode(action.Chain, action.TxSender),
// Need to manually set gas limit past default (200000), since redelegate has a lot of operations
- `--gas`, "auto",
+ `--gas`, "900000",
`--keyring-backend`, `test`,
`-y`,
)
@@ -1646,9 +1617,7 @@ func (tr TestConfig) unjailValidator(action unjailValidatorAction, verbose bool)
`--chain-id`, string(tr.chainConfigs[action.Provider].ChainId),
`--home`, tr.getValidatorHome(action.Provider, action.Validator),
`--node`, tr.getValidatorNode(action.Provider, action.Validator),
- `--gas`, "auto",
- `--gas-prices`, `0.0025stake`,
- `--gas-adjustment`, `1.5`,
+ `--gas`, "900000",
`--keyring-backend`, `test`,
`-y`,
)
@@ -1706,9 +1675,6 @@ func (tr TestConfig) registerRepresentative(
`--commission-max-change-rate`, "0.01",
`--min-self-delegation`, "1",
`--from`, `validator`+fmt.Sprint(val),
- `--gas`, "auto",
- `--gas-prices`, `0.0025stake`,
- `--gas-adjustment`, `1.5`,
`--chain-id`, string(tr.chainConfigs[action.Chain].ChainId),
`--home`, tr.getValidatorHome(action.Chain, val),
`--node`, tr.getValidatorNode(action.Chain, val),
@@ -1773,9 +1739,7 @@ func (tr TestConfig) submitChangeRewardDenomsProposal(action submitChangeRewardD
`--chain-id`, string(providerChain.ChainId),
`--home`, tr.getValidatorHome(providerChain.ChainId, action.From),
`--node`, tr.getValidatorNode(providerChain.ChainId, action.From),
- `--gas`, "auto",
- `--gas-prices`, `0.0025stake`,
- `--gas-adjustment`, `1.5`,
+ `--gas`, "9000000",
`--keyring-backend`, `test`,
`-y`,
).CombinedOutput()
@@ -1928,7 +1892,7 @@ func (tr TestConfig) assignConsumerPubKey(action assignConsumerPubKeyAction, ver
gas = "9000000"
}
assignKey := fmt.Sprintf(
- `%s tx provider assign-consensus-key %s '%s' --from validator%s --chain-id %s --home %s --node %s --gas %s --gas-prices %s --gas-adjustment 1.5 --keyring-backend test -y -o json`,
+ `%s tx provider assign-consensus-key %s '%s' --from validator%s --chain-id %s --home %s --node %s --gas %s --keyring-backend test -y -o json`,
tr.chainConfigs[ChainID("provi")].BinaryName,
string(tr.chainConfigs[action.Chain].ChainId),
action.ConsumerPubkey,
@@ -1937,7 +1901,6 @@ func (tr TestConfig) assignConsumerPubKey(action assignConsumerPubKeyAction, ver
tr.getValidatorHome(ChainID("provi"), action.Validator),
tr.getValidatorNode(ChainID("provi"), action.Validator),
gas,
- `0.0025stake`,
)
//#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments.
diff --git a/tests/e2e/steps_start_chains.go b/tests/e2e/steps_start_chains.go
index 9e6541bfe9..58a5f75162 100644
--- a/tests/e2e/steps_start_chains.go
+++ b/tests/e2e/steps_start_chains.go
@@ -10,12 +10,20 @@ func stepStartProviderChain() []Step {
Action: StartChainAction{
Chain: ChainID("provi"),
Validators: []StartChainValidator{
- {Id: ValidatorID("bob"), Stake: 500000000, Allocation: 1000000000000000},
- {Id: ValidatorID("alice"), Stake: 500000000, Allocation: 1000000000000000},
- {Id: ValidatorID("carol"), Stake: 500000000, Allocation: 1000000000000000},
+ {Id: ValidatorID("bob"), Stake: 500000000, Allocation: 10000000000},
+ {Id: ValidatorID("alice"), Stake: 500000000, Allocation: 10000000000},
+ {Id: ValidatorID("carol"), Stake: 500000000, Allocation: 10000000000},
+ },
+ },
+ State: State{
+ ChainID("provi"): ChainState{
+ ValBalances: &map[ValidatorID]uint{
+ ValidatorID("alice"): 9500000000,
+ ValidatorID("bob"): 9500000000,
+ ValidatorID("carol"): 9500000000,
+ },
},
},
- State: State{},
},
}
}
@@ -33,6 +41,10 @@ func stepsStartConsumerChain(consumerName string, proposalIndex, chainIndex uint
},
State: State{
ChainID("provi"): ChainState{
+ ValBalances: &map[ValidatorID]uint{
+ ValidatorID("alice"): 9489999999,
+ ValidatorID("bob"): 9500000000,
+ },
Proposals: &map[uint]Proposal{
proposalIndex: ConsumerAdditionProposal{
Deposit: 10000001,
@@ -122,6 +134,10 @@ func stepsStartConsumerChain(consumerName string, proposalIndex, chainIndex uint
Status: "PROPOSAL_STATUS_PASSED",
},
},
+ ValBalances: &map[ValidatorID]uint{
+ ValidatorID("alice"): 9500000000,
+ ValidatorID("bob"): 9500000000,
+ },
},
},
},
@@ -141,7 +157,23 @@ func stepsStartConsumerChain(consumerName string, proposalIndex, chainIndex uint
// values from the genesis file.
GenesisChanges: ".app_state.ccvconsumer.params.soft_opt_out_threshold = \"0.05\"",
},
- State: State{},
+ State: State{
+ ChainID("provi"): ChainState{
+ ValBalances: &map[ValidatorID]uint{
+ ValidatorID("alice"): 9500000000,
+ ValidatorID("bob"): 9500000000,
+ ValidatorID("carol"): 9500000000,
+ },
+ ProposedConsumerChains: &[]string{},
+ },
+ ChainID(consumerName): ChainState{
+ ValBalances: &map[ValidatorID]uint{
+ ValidatorID("alice"): 10000000000,
+ ValidatorID("bob"): 10000000000,
+ ValidatorID("carol"): 10000000000,
+ },
+ },
+ },
},
{
Action: addIbcConnectionAction{
diff --git a/tests/e2e/testnet-scripts/start-chain.sh b/tests/e2e/testnet-scripts/start-chain.sh
index 769253ce0f..e3e6b6054f 100644
--- a/tests/e2e/testnet-scripts/start-chain.sh
+++ b/tests/e2e/testnet-scripts/start-chain.sh
@@ -198,7 +198,6 @@ do
#'s/foo/bar/;s/abc/def/'
sed -i "$TENDERMINT_CONFIG_TRANSFORM" $CHAIN_ID/validator$VAL_ID/config/config.toml
fi
- sed -i 's/minimum-gas-prices = "0stake"/minimum-gas-prices = "0.0025stake"/g' $CHAIN_ID/validator$VAL_ID/config/app.toml
done