Skip to content

Commit

Permalink
Revert changes to e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
p-offtermatt committed Nov 30, 2023
1 parent 703e462 commit b8db7bc
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 57 deletions.
65 changes: 14 additions & 51 deletions tests/e2e/actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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),
Expand Down Expand Up @@ -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))
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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`,
)
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -685,7 +669,7 @@ ccv_consumer_chain = %v
[chains.gas_price]
denom = "stake"
price = 0.025
price = 0.000
[chains.trust_threshold]
denominator = "3"
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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),
Expand Down Expand Up @@ -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`,
)
Expand Down Expand Up @@ -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`,
Expand Down Expand Up @@ -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`,
)
Expand Down Expand Up @@ -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`,
)
Expand Down Expand Up @@ -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),
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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,
Expand All @@ -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.
Expand Down
42 changes: 37 additions & 5 deletions tests/e2e/steps_start_chains.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{},
},
}
}
Expand All @@ -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,
Expand Down Expand Up @@ -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,
},
},
},
},
Expand All @@ -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{
Expand Down
1 change: 0 additions & 1 deletion tests/e2e/testnet-scripts/start-chain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down

0 comments on commit b8db7bc

Please sign in to comment.