From 216f3958238591e1b4627919f3ea8fe5a02dfe1b Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Fri, 6 Sep 2024 18:47:25 +0200 Subject: [PATCH] test: fix e2e-tests (#2234) * fix event name + inccorect gov status * bump Hermes to from 1.10.0 to 1.10.2 fixing a parsing error when relaying VSC packets * remove rogue file * fix bash script to query block at height 1 instead of 0 --- Dockerfile | 2 +- Dockerfile.combined | 2 +- Dockerfile.gaia | 2 +- tests/e2e/actions.go | 4 ++-- tests/e2e/json_marshal_test.go | 5 ++--- tests/e2e/steps.go | 9 +++------ tests/e2e/steps_active_set_changes.go | 9 +++------ tests/e2e/steps_compatibility.go | 9 +++------ tests/e2e/steps_consumer_misbehaviour.go | 9 +++------ tests/e2e/steps_democracy.go | 6 ++---- tests/e2e/steps_inactive_vals.go | 25 +++++++++++------------- tests/e2e/steps_partial_set_security.go | 13 ++++++------ tests/e2e/steps_sovereign_changeover.go | 13 +++++------- tests/e2e/steps_start_chains.go | 9 +++------ tests/e2e/steps_stop_chain.go | 10 ++++------ tests/e2e/testnet-scripts/start-chain.sh | 5 +++-- tests/e2e/trace_handlers_test.go | 14 +++++-------- 17 files changed, 58 insertions(+), 88 deletions(-) diff --git a/Dockerfile b/Dockerfile index 84ae4d5285..adb9aff120 100644 --- a/Dockerfile +++ b/Dockerfile @@ -29,7 +29,7 @@ RUN go mod tidy RUN make install # Get Hermes build -FROM --platform=linux/amd64 ghcr.io/informalsystems/hermes:1.10.0 AS hermes-builder +FROM --platform=linux/amd64 ghcr.io/informalsystems/hermes:1.10.2 AS hermes-builder # Get CometMock FROM ghcr.io/informalsystems/cometmock:v0.38.x as cometmock-builder diff --git a/Dockerfile.combined b/Dockerfile.combined index 5335b3ee05..47a8fad86a 100644 --- a/Dockerfile.combined +++ b/Dockerfile.combined @@ -24,7 +24,7 @@ FROM --platform=linux/amd64 ${PROVIDER_IMAGE} AS provider FROM --platform=linux/amd64 ${CONSUMER_IMAGE} AS consumer # Get Hermes build -FROM --platform=linux/amd64 ghcr.io/informalsystems/hermes:1.10.0 AS hermes-builder +FROM --platform=linux/amd64 ghcr.io/informalsystems/hermes:1.10.2 AS hermes-builder # Get GoRelayer diff --git a/Dockerfile.gaia b/Dockerfile.gaia index 1681ecc8b1..314dc2881c 100644 --- a/Dockerfile.gaia +++ b/Dockerfile.gaia @@ -61,7 +61,7 @@ WORKDIR /interchain-security RUN make install # Get Hermes build -FROM --platform=linux/amd64 ghcr.io/informalsystems/hermes:1.10.0 AS hermes-builder +FROM --platform=linux/amd64 ghcr.io/informalsystems/hermes:1.10.2 AS hermes-builder FROM --platform=linux/amd64 fedora:39 RUN dnf update -y diff --git a/tests/e2e/actions.go b/tests/e2e/actions.go index 3ef0a0bf9d..a47219b5af 100644 --- a/tests/e2e/actions.go +++ b/tests/e2e/actions.go @@ -509,12 +509,12 @@ func (tr Chain) CreateConsumer(providerChain, consumerChain ChainID, validator V consumerId := "" for _, event := range txResponse.Events { - if event.Type != "consumer_creation" { + if event.Type != "create_consumer" { continue } attr, exists := event.GetAttribute("consumer_id") if !exists { - log.Fatalf("no event with consumer_id found in tx content of create-consumer: %v", event) + log.Fatalf("no event with consumer_id found in tx content of create_consumer: %v", event) } consumerId = attr.Value } diff --git a/tests/e2e/json_marshal_test.go b/tests/e2e/json_marshal_test.go index 12ea80f718..564df54e36 100644 --- a/tests/e2e/json_marshal_test.go +++ b/tests/e2e/json_marshal_test.go @@ -3,7 +3,6 @@ package main import ( "encoding/json" "reflect" - "strconv" "strings" "testing" @@ -34,7 +33,7 @@ func TestProposalUnmarshal(t *testing.T) { Chain: ChainID("consu"), SpawnTime: 0, InitialHeight: clienttypes.Height{RevisionNumber: 0, RevisionHeight: 1}, - Status: strconv.Itoa(int(gov.ProposalStatus_PROPOSAL_STATUS_PASSED)), + Status: gov.ProposalStatus_PROPOSAL_STATUS_PASSED.String(), } type ProposalAndType struct { @@ -101,7 +100,7 @@ var testCases = []ChainStateTestCase{ Chain: ChainID("consu"), SpawnTime: 0, InitialHeight: clienttypes.Height{RevisionNumber: 0, RevisionHeight: 1}, - Status: strconv.Itoa(int(gov.ProposalStatus_PROPOSAL_STATUS_PASSED)), + Status: gov.ProposalStatus_PROPOSAL_STATUS_PASSED.String(), }, }, }, diff --git a/tests/e2e/steps.go b/tests/e2e/steps.go index e2c64745fd..b9b635452f 100644 --- a/tests/e2e/steps.go +++ b/tests/e2e/steps.go @@ -1,11 +1,8 @@ package main import ( - "strconv" - - clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" - gov "github.com/cosmos/cosmos-sdk/x/gov/types/v1" + clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" ) type Step struct { @@ -208,7 +205,7 @@ func stepsInactiveValsTopNReproduce() []Step { Chain: ChainID("consu"), SpawnTime: 0, InitialHeight: clienttypes.Height{RevisionNumber: 0, RevisionHeight: 1}, - Status: strconv.Itoa(int(gov.ProposalStatus_PROPOSAL_STATUS_VOTING_PERIOD)), + Status: gov.ProposalStatus_PROPOSAL_STATUS_VOTING_PERIOD.String(), }, }, }, @@ -229,7 +226,7 @@ func stepsInactiveValsTopNReproduce() []Step { Chain: ChainID("consu"), SpawnTime: 0, InitialHeight: clienttypes.Height{RevisionNumber: 0, RevisionHeight: 1}, - Status: strconv.Itoa(int(gov.ProposalStatus_PROPOSAL_STATUS_PASSED)), + Status: gov.ProposalStatus_PROPOSAL_STATUS_PASSED.String(), }, }, HasToValidate: &map[ValidatorID][]ChainID{ diff --git a/tests/e2e/steps_active_set_changes.go b/tests/e2e/steps_active_set_changes.go index 8e4a1d5128..dda2f3ae26 100644 --- a/tests/e2e/steps_active_set_changes.go +++ b/tests/e2e/steps_active_set_changes.go @@ -1,11 +1,8 @@ package main import ( - "strconv" - - clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" - gov "github.com/cosmos/cosmos-sdk/x/gov/types/v1" + clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" ) // stepsActiveSetChanges starts a top N provider chain and causes a change in the active set @@ -49,7 +46,7 @@ func stepsActiveSetChanges() []Step { Chain: ChainID("consu"), SpawnTime: 0, InitialHeight: clienttypes.Height{RevisionNumber: 0, RevisionHeight: 1}, - Status: strconv.Itoa(int(gov.ProposalStatus_PROPOSAL_STATUS_VOTING_PERIOD)), + Status: gov.ProposalStatus_PROPOSAL_STATUS_VOTING_PERIOD.String(), }, }, HasToValidate: &map[ValidatorID][]ChainID{ @@ -75,7 +72,7 @@ func stepsActiveSetChanges() []Step { Chain: ChainID("consu"), SpawnTime: 0, InitialHeight: clienttypes.Height{RevisionNumber: 0, RevisionHeight: 1}, - Status: strconv.Itoa(int(gov.ProposalStatus_PROPOSAL_STATUS_PASSED)), + Status: gov.ProposalStatus_PROPOSAL_STATUS_PASSED.String(), }, }, }, diff --git a/tests/e2e/steps_compatibility.go b/tests/e2e/steps_compatibility.go index 8e23eca016..628fefafc3 100644 --- a/tests/e2e/steps_compatibility.go +++ b/tests/e2e/steps_compatibility.go @@ -4,11 +4,8 @@ package main // sanity checks across different ICS versions. import ( - "strconv" - - clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" - gov "github.com/cosmos/cosmos-sdk/x/gov/types/v1" + clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" providertypes "github.com/cosmos/interchain-security/v6/x/ccv/provider/types" ) @@ -61,7 +58,7 @@ func compstepsStartConsumerChain(consumerName string, proposalIndex, chainIndex Chain: ChainID(consumerName), SpawnTime: 0, InitialHeight: clienttypes.Height{RevisionNumber: 0, RevisionHeight: 1}, - Status: strconv.Itoa(int(gov.ProposalStatus_PROPOSAL_STATUS_VOTING_PERIOD)), // breaking change in SDK: gov.ProposalStatus(gov.ProposalStatus_PROPOSAL_STATUS_VOTING_PERIOD).String(), + Status: gov.ProposalStatus_PROPOSAL_STATUS_VOTING_PERIOD.String(), // breaking change in SDK: gov.ProposalStatus(gov.ProposalStatus_PROPOSAL_STATUS_VOTING_PERIOD).String(), }, }, // not supported across major versions @@ -130,7 +127,7 @@ func compstepsStartConsumerChain(consumerName string, proposalIndex, chainIndex Chain: ChainID(consumerName), SpawnTime: 0, InitialHeight: clienttypes.Height{RevisionNumber: 0, RevisionHeight: 1}, - Status: strconv.Itoa(int(gov.ProposalStatus_PROPOSAL_STATUS_PASSED)), // TODO: CHECK if this is bug on SDK SIDE!!!: should be as before gov.ProposalStatus(gov.ProposalStatus_PROPOSAL_STATUS_PASSED).String(), + Status: gov.ProposalStatus_PROPOSAL_STATUS_PASSED.String(), }, }, ValBalances: &map[ValidatorID]uint{ diff --git a/tests/e2e/steps_consumer_misbehaviour.go b/tests/e2e/steps_consumer_misbehaviour.go index 63d83382d1..0374e60256 100644 --- a/tests/e2e/steps_consumer_misbehaviour.go +++ b/tests/e2e/steps_consumer_misbehaviour.go @@ -1,11 +1,8 @@ package main import ( - "strconv" - - clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" - gov "github.com/cosmos/cosmos-sdk/x/gov/types/v1" + clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" ) // starts a provider chain and an Opt-In consumer chain with one validator @@ -52,7 +49,7 @@ func stepsStartChainsForConsumerMisbehaviour(consumerName string) []Step { Chain: ChainID(consumerName), SpawnTime: 0, InitialHeight: clienttypes.Height{RevisionNumber: 0, RevisionHeight: 1}, - Status: strconv.Itoa(int(gov.ProposalStatus_PROPOSAL_STATUS_VOTING_PERIOD)), + Status: gov.ProposalStatus_PROPOSAL_STATUS_VOTING_PERIOD.String(), }, }, }, @@ -103,7 +100,7 @@ func stepsStartChainsForConsumerMisbehaviour(consumerName string) []Step { Chain: ChainID(consumerName), SpawnTime: 0, InitialHeight: clienttypes.Height{RevisionNumber: 0, RevisionHeight: 1}, - Status: strconv.Itoa(int(gov.ProposalStatus_PROPOSAL_STATUS_PASSED)), + Status: gov.ProposalStatus_PROPOSAL_STATUS_PASSED.String(), }, }, ValBalances: &map[ValidatorID]uint{ diff --git a/tests/e2e/steps_democracy.go b/tests/e2e/steps_democracy.go index ef9c3787f0..df506639e4 100644 --- a/tests/e2e/steps_democracy.go +++ b/tests/e2e/steps_democracy.go @@ -1,8 +1,6 @@ package main import ( - "strconv" - gov "github.com/cosmos/cosmos-sdk/x/gov/types/v1" ) @@ -91,7 +89,7 @@ func stepsDemocracy(consumerName string, expectRegisteredRewardDistribution bool Proposals: &map[uint]Proposal{ 1: IBCTransferParamsProposal{ Deposit: 10000001, - Status: strconv.Itoa(int(gov.ProposalStatus_PROPOSAL_STATUS_VOTING_PERIOD)), + Status: gov.ProposalStatus_PROPOSAL_STATUS_VOTING_PERIOD.String(), Title: "Enable IBC Send", Params: IBCTransferParams{SendEnabled: true, ReceiveEnabled: true}, }, @@ -118,7 +116,7 @@ func stepsDemocracy(consumerName string, expectRegisteredRewardDistribution bool Proposals: &map[uint]Proposal{ 1: IBCTransferParamsProposal{ Deposit: 10000001, - Status: strconv.Itoa(int(gov.ProposalStatus_PROPOSAL_STATUS_PASSED)), + Status: gov.ProposalStatus_PROPOSAL_STATUS_PASSED.String(), Title: "Enable IBC Send", Params: IBCTransferParams{SendEnabled: true, ReceiveEnabled: true}, }, diff --git a/tests/e2e/steps_inactive_vals.go b/tests/e2e/steps_inactive_vals.go index 1ec4c5b413..9cc397a362 100644 --- a/tests/e2e/steps_inactive_vals.go +++ b/tests/e2e/steps_inactive_vals.go @@ -1,11 +1,8 @@ package main import ( - "strconv" - - clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" - gov "github.com/cosmos/cosmos-sdk/x/gov/types/v1" + clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" ) // stepsInactiveValidatorsOnConsumer tests situations where validators that are *not* in the active set on the @@ -373,7 +370,7 @@ func setupOptInChain() []Step { Chain: ChainID("consu"), SpawnTime: 0, InitialHeight: clienttypes.Height{RevisionNumber: 0, RevisionHeight: 1}, - Status: strconv.Itoa(int(gov.ProposalStatus_PROPOSAL_STATUS_VOTING_PERIOD)), + Status: gov.ProposalStatus_PROPOSAL_STATUS_VOTING_PERIOD.String(), }, }, HasToValidate: &map[ValidatorID][]ChainID{ @@ -402,7 +399,7 @@ func setupOptInChain() []Step { Chain: ChainID("consu"), SpawnTime: 0, InitialHeight: clienttypes.Height{RevisionNumber: 0, RevisionHeight: 1}, - Status: strconv.Itoa(int(gov.ProposalStatus_PROPOSAL_STATUS_PASSED)), + Status: gov.ProposalStatus_PROPOSAL_STATUS_PASSED.String(), }, }, }, @@ -531,7 +528,7 @@ func stepsInactiveProviderValidatorsGovernance() []Step { Chain: ChainID("consu"), SpawnTime: 0, InitialHeight: clienttypes.Height{RevisionNumber: 0, RevisionHeight: 1}, - Status: strconv.Itoa(int(gov.ProposalStatus_PROPOSAL_STATUS_VOTING_PERIOD)), + Status: gov.ProposalStatus_PROPOSAL_STATUS_VOTING_PERIOD.String(), }, }, }, @@ -555,7 +552,7 @@ func stepsInactiveProviderValidatorsGovernance() []Step { InitialHeight: clienttypes.Height{RevisionNumber: 0, RevisionHeight: 1}, // the proposal should have passed because carol voted for it. // carol alone is enough to pass the quorum, because stake of the other validators is not counted - Status: strconv.Itoa(int(gov.ProposalStatus_PROPOSAL_STATUS_PASSED)), + Status: gov.ProposalStatus_PROPOSAL_STATUS_PASSED.String(), }, }, }, @@ -618,7 +615,7 @@ func stepsInactiveProviderValidatorsGovernanceBasecase() []Step { Chain: ChainID("consu"), SpawnTime: 0, InitialHeight: clienttypes.Height{RevisionNumber: 0, RevisionHeight: 1}, - Status: strconv.Itoa(int(gov.ProposalStatus_PROPOSAL_STATUS_VOTING_PERIOD)), + Status: gov.ProposalStatus_PROPOSAL_STATUS_VOTING_PERIOD.String(), }, }, }, @@ -642,7 +639,7 @@ func stepsInactiveProviderValidatorsGovernanceBasecase() []Step { InitialHeight: clienttypes.Height{RevisionNumber: 0, RevisionHeight: 1}, // the proposal should *not* have passed because only carol voted for it, // and carol is not enough to pass the quorum - Status: strconv.Itoa(int(gov.ProposalStatus_PROPOSAL_STATUS_REJECTED)), + Status: gov.ProposalStatus_PROPOSAL_STATUS_REJECTED.String(), }, }, }, @@ -703,7 +700,7 @@ func stepsMinStake() []Step { Chain: ChainID("consu"), SpawnTime: 0, InitialHeight: clienttypes.Height{RevisionNumber: 0, RevisionHeight: 1}, - Status: strconv.Itoa(int(gov.ProposalStatus_PROPOSAL_STATUS_VOTING_PERIOD)), + Status: gov.ProposalStatus_PROPOSAL_STATUS_VOTING_PERIOD.String(), }, }, }, @@ -727,7 +724,7 @@ func stepsMinStake() []Step { Chain: ChainID("consu"), SpawnTime: 0, InitialHeight: clienttypes.Height{RevisionNumber: 0, RevisionHeight: 1}, - Status: strconv.Itoa(int(gov.ProposalStatus_PROPOSAL_STATUS_PASSED)), + Status: gov.ProposalStatus_PROPOSAL_STATUS_PASSED.String(), }, }, }, @@ -821,7 +818,7 @@ func stepsInactiveValsWithTopN() []Step { Chain: ChainID("consu"), SpawnTime: 0, InitialHeight: clienttypes.Height{RevisionNumber: 0, RevisionHeight: 1}, - Status: strconv.Itoa(int(gov.ProposalStatus_PROPOSAL_STATUS_VOTING_PERIOD)), + Status: gov.ProposalStatus_PROPOSAL_STATUS_VOTING_PERIOD.String(), }, }, }, @@ -842,7 +839,7 @@ func stepsInactiveValsWithTopN() []Step { Chain: ChainID("consu"), SpawnTime: 0, InitialHeight: clienttypes.Height{RevisionNumber: 0, RevisionHeight: 1}, - Status: strconv.Itoa(int(gov.ProposalStatus_PROPOSAL_STATUS_PASSED)), + Status: gov.ProposalStatus_PROPOSAL_STATUS_PASSED.String(), }, }, HasToValidate: &map[ValidatorID][]ChainID{ diff --git a/tests/e2e/steps_partial_set_security.go b/tests/e2e/steps_partial_set_security.go index 5a08ddda78..f2646c5cd3 100644 --- a/tests/e2e/steps_partial_set_security.go +++ b/tests/e2e/steps_partial_set_security.go @@ -1,7 +1,6 @@ package main import ( - "strconv" "time" clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" @@ -576,7 +575,7 @@ func stepsTopNChain() []Step { Chain: ChainID("consu"), SpawnTime: 0, InitialHeight: clienttypes.Height{RevisionNumber: 0, RevisionHeight: 1}, - Status: strconv.Itoa(int(gov.ProposalStatus_PROPOSAL_STATUS_VOTING_PERIOD)), + Status: gov.ProposalStatus_PROPOSAL_STATUS_VOTING_PERIOD.String(), }, }, }, @@ -609,7 +608,7 @@ func stepsTopNChain() []Step { Chain: ChainID("consu"), SpawnTime: 0, InitialHeight: clienttypes.Height{RevisionNumber: 0, RevisionHeight: 1}, - Status: strconv.Itoa(int(gov.ProposalStatus_PROPOSAL_STATUS_PASSED)), + Status: gov.ProposalStatus_PROPOSAL_STATUS_PASSED.String(), }, }, }, @@ -1258,7 +1257,7 @@ func stepsValidatorsPowerCappedChain() []Step { Chain: ChainID("consu"), SpawnTime: 0, InitialHeight: clienttypes.Height{RevisionNumber: 0, RevisionHeight: 1}, - Status: strconv.Itoa(int(gov.ProposalStatus_PROPOSAL_STATUS_VOTING_PERIOD)), + Status: gov.ProposalStatus_PROPOSAL_STATUS_VOTING_PERIOD.String(), }, }, HasToValidate: &map[ValidatorID][]ChainID{ @@ -1343,7 +1342,7 @@ func stepsValidatorsPowerCappedChain() []Step { Chain: ChainID("consu"), SpawnTime: 0, InitialHeight: clienttypes.Height{RevisionNumber: 0, RevisionHeight: 1}, - Status: strconv.Itoa(int(gov.ProposalStatus_PROPOSAL_STATUS_PASSED)), + Status: gov.ProposalStatus_PROPOSAL_STATUS_PASSED.String(), }, }, }, @@ -2174,7 +2173,7 @@ func stepsModifyChain() []Step { 1: ConsumerAdditionProposal{ Deposit: 10000001, Chain: ChainID("consu"), - Status: strconv.Itoa(int(gov.ProposalStatus_PROPOSAL_STATUS_VOTING_PERIOD)), + Status: gov.ProposalStatus_PROPOSAL_STATUS_VOTING_PERIOD.String(), }, }, }, @@ -2193,7 +2192,7 @@ func stepsModifyChain() []Step { 1: ConsumerAdditionProposal{ Deposit: 10000001, Chain: ChainID("consu"), - Status: strconv.Itoa(int(gov.ProposalStatus_PROPOSAL_STATUS_PASSED)), + Status: gov.ProposalStatus_PROPOSAL_STATUS_PASSED.String(), }, }, }, diff --git a/tests/e2e/steps_sovereign_changeover.go b/tests/e2e/steps_sovereign_changeover.go index f66eb14dfe..23d595b8d4 100644 --- a/tests/e2e/steps_sovereign_changeover.go +++ b/tests/e2e/steps_sovereign_changeover.go @@ -1,11 +1,8 @@ package main import ( - "strconv" - - clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" - gov "github.com/cosmos/cosmos-sdk/x/gov/types/v1" + clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" ) // this creates new clients on both chains and a connection (connection-0) between them @@ -68,7 +65,7 @@ func stepsChangeoverToConsumer(consumerName string) []Step { Chain: ChainID(consumerName), SpawnTime: 0, InitialHeight: clienttypes.Height{RevisionNumber: 0, RevisionHeight: 111}, - Status: strconv.Itoa(int(gov.ProposalStatus_PROPOSAL_STATUS_VOTING_PERIOD)), + Status: gov.ProposalStatus_PROPOSAL_STATUS_VOTING_PERIOD.String(), }, }, }, @@ -89,7 +86,7 @@ func stepsChangeoverToConsumer(consumerName string) []Step { Chain: ChainID(consumerName), SpawnTime: 0, InitialHeight: clienttypes.Height{RevisionNumber: 0, RevisionHeight: 111}, - Status: strconv.Itoa(int(gov.ProposalStatus_PROPOSAL_STATUS_PASSED)), + Status: gov.ProposalStatus_PROPOSAL_STATUS_PASSED.String(), }, }, ValBalances: &map[ValidatorID]uint{ @@ -213,7 +210,7 @@ func stepsUpgradeChain() []Step { UpgradeHeight: 110, Type: "/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal", Deposit: 10000000, - Status: strconv.Itoa(int(gov.ProposalStatus_PROPOSAL_STATUS_VOTING_PERIOD)), + Status: gov.ProposalStatus_PROPOSAL_STATUS_VOTING_PERIOD.String(), }, }, }, @@ -234,7 +231,7 @@ func stepsUpgradeChain() []Step { UpgradeHeight: 110, Title: "sovereign-changeover", Type: "/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal", - Status: strconv.Itoa(int(gov.ProposalStatus_PROPOSAL_STATUS_PASSED)), + Status: gov.ProposalStatus_PROPOSAL_STATUS_PASSED.String(), }, }, }, diff --git a/tests/e2e/steps_start_chains.go b/tests/e2e/steps_start_chains.go index de468e75db..640816aaeb 100644 --- a/tests/e2e/steps_start_chains.go +++ b/tests/e2e/steps_start_chains.go @@ -1,11 +1,8 @@ package main import ( - "strconv" - - clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" - gov "github.com/cosmos/cosmos-sdk/x/gov/types/v1" + clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" ) func stepStartProviderChain() []Step { @@ -56,7 +53,7 @@ func stepsStartConsumerChain(consumerName string, proposalIndex, chainIndex uint Chain: ChainID(consumerName), SpawnTime: 0, InitialHeight: clienttypes.Height{RevisionNumber: 0, RevisionHeight: 1}, - Status: strconv.Itoa(int(gov.ProposalStatus_PROPOSAL_STATUS_VOTING_PERIOD)), + Status: gov.ProposalStatus_PROPOSAL_STATUS_VOTING_PERIOD.String(), }, }, ProposedConsumerChains: &[]string{consumerName}, @@ -136,7 +133,7 @@ func stepsStartConsumerChain(consumerName string, proposalIndex, chainIndex uint Chain: ChainID(consumerName), SpawnTime: 0, InitialHeight: clienttypes.Height{RevisionNumber: 0, RevisionHeight: 1}, - Status: strconv.Itoa(int(gov.ProposalStatus_PROPOSAL_STATUS_PASSED)), + Status: gov.ProposalStatus_PROPOSAL_STATUS_PASSED.String(), }, }, ValBalances: &map[ValidatorID]uint{ diff --git a/tests/e2e/steps_stop_chain.go b/tests/e2e/steps_stop_chain.go index a88d8288b7..a5753e594b 100644 --- a/tests/e2e/steps_stop_chain.go +++ b/tests/e2e/steps_stop_chain.go @@ -1,8 +1,6 @@ package main import ( - "strconv" - gov "github.com/cosmos/cosmos-sdk/x/gov/types/v1" ) @@ -35,7 +33,7 @@ func stepsStopChain(consumerName string, propNumber uint) []Step { propNumber: ConsumerRemovalProposal{ Deposit: 10000001, Chain: ChainID(consumerName), - Status: strconv.Itoa(int(gov.ProposalStatus_PROPOSAL_STATUS_VOTING_PERIOD)), + Status: gov.ProposalStatus_PROPOSAL_STATUS_VOTING_PERIOD.String(), }, }, ConsumerChains: &map[ChainID]bool{"consu": true}, // consumer chain not yet removed @@ -55,7 +53,7 @@ func stepsStopChain(consumerName string, propNumber uint) []Step { propNumber: ConsumerRemovalProposal{ Deposit: 10000001, Chain: ChainID(consumerName), - Status: strconv.Itoa(int(gov.ProposalStatus_PROPOSAL_STATUS_PASSED)), + Status: gov.ProposalStatus_PROPOSAL_STATUS_PASSED.String(), }, }, ValBalances: &map[ValidatorID]uint{ @@ -90,7 +88,7 @@ func stepsConsumerRemovalPropNotPassing(consumerName string, propNumber uint) [] propNumber: ConsumerRemovalProposal{ Deposit: 10000001, Chain: ChainID(consumerName), - Status: strconv.Itoa(int(gov.ProposalStatus_PROPOSAL_STATUS_VOTING_PERIOD)), + Status: gov.ProposalStatus_PROPOSAL_STATUS_VOTING_PERIOD.String(), }, }, ConsumerChains: &map[ChainID]bool{"consu": true}, // consumer chain not removed @@ -110,7 +108,7 @@ func stepsConsumerRemovalPropNotPassing(consumerName string, propNumber uint) [] propNumber: ConsumerRemovalProposal{ Deposit: 10000001, Chain: ChainID(consumerName), - Status: strconv.Itoa(int(gov.ProposalStatus_PROPOSAL_STATUS_REJECTED)), + Status: gov.ProposalStatus_PROPOSAL_STATUS_REJECTED.String(), }, }, ValBalances: &map[ValidatorID]uint{ diff --git a/tests/e2e/testnet-scripts/start-chain.sh b/tests/e2e/testnet-scripts/start-chain.sh index 29091d8b19..6ad97b3589 100644 --- a/tests/e2e/testnet-scripts/start-chain.sh +++ b/tests/e2e/testnet-scripts/start-chain.sh @@ -377,15 +377,16 @@ fi # poll for chain start if [[ "$USE_COMETMOCK" == "true" ]]; then set +e - until $BIN query block --type=height 0 --node "tcp://$CHAIN_IP_PREFIX.$QUERY_IP_SUFFIX:26658"; do sleep 0.3 ; done + until $BIN query block --type=height 1--node "tcp://$CHAIN_IP_PREFIX.$QUERY_IP_SUFFIX:26658"; do sleep 0.3 ; done set -e else set +e - until $BIN query block --type=height 0 --node "tcp://$CHAIN_IP_PREFIX.$QUERY_IP_SUFFIX:26658" | grep -q -v '{"block_id":{"hash":"","parts":{"total":0,"hash": + until $BIN query block --type=height 1 --node "tcp://$CHAIN_IP_PREFIX.$QUERY_IP_SUFFIX:26658" | grep -q -v '{"block_id":{"hash":"","parts":{"total":0,"hash": ""}},"block":null}'; do sleep 0.3 ; done set -e fi + echo "done!!!!!!!!" read -p "Press Return to Close..." diff --git a/tests/e2e/trace_handlers_test.go b/tests/e2e/trace_handlers_test.go index 35b2647ca4..fe15656545 100644 --- a/tests/e2e/trace_handlers_test.go +++ b/tests/e2e/trace_handlers_test.go @@ -6,7 +6,6 @@ import ( "log" "os" "path/filepath" - "strconv" "testing" clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" @@ -30,7 +29,7 @@ var proposalInStateSteps = []Step{ 1: ConsumerRemovalProposal{ Deposit: 10000001, Chain: ChainID("foo"), - Status: strconv.Itoa(int(gov.ProposalStatus_PROPOSAL_STATUS_VOTING_PERIOD)), + Status: gov.ProposalStatus_PROPOSAL_STATUS_VOTING_PERIOD.String(), }, }, }, @@ -116,7 +115,7 @@ func TestMarshalAndUnmarshalChainState(t *testing.T) { Chain: ChainID("test"), SpawnTime: 0, InitialHeight: clienttypes.Height{RevisionNumber: 5, RevisionHeight: 5}, - Status: strconv.Itoa(int(gov.ProposalStatus_PROPOSAL_STATUS_VOTING_PERIOD)), + Status: gov.ProposalStatus_PROPOSAL_STATUS_VOTING_PERIOD.String(), }, }, }}, @@ -128,11 +127,8 @@ func TestMarshalAndUnmarshalChainState(t *testing.T) { Proposals: &map[uint]Proposal{ 1: IBCTransferParamsProposal{ Deposit: 10000001, - Status: strconv.Itoa(int(gov.ProposalStatus_PROPOSAL_STATUS_VOTING_PERIOD)), - Params: IBCTransferParams{ - SendEnabled: true, - ReceiveEnabled: true, - }, + Status: gov.ProposalStatus_PROPOSAL_STATUS_VOTING_PERIOD.String(), + Params: IBCTransferParams{true, true}, }, }, }}, @@ -141,7 +137,7 @@ func TestMarshalAndUnmarshalChainState(t *testing.T) { 5: ConsumerRemovalProposal{ Deposit: 10000001, Chain: ChainID("test123"), - Status: strconv.Itoa(int(gov.ProposalStatus_PROPOSAL_STATUS_PASSED)), + Status: gov.ProposalStatus_PROPOSAL_STATUS_PASSED.String(), }, }, ValBalances: &map[ValidatorID]uint{