Skip to content

Commit

Permalink
add e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
Yaru Wang committed Sep 20, 2023
1 parent 402fcd4 commit 27daf3a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
10 changes: 5 additions & 5 deletions tests/e2e/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type State map[ChainID]ChainState
type ChainState struct {
ValBalances *map[ValidatorID]uint
Proposals *map[uint]Proposal
ProposedConsumerChains []string
ProposedConsumerChains *[]string
ValPowers *map[ValidatorID]uint
RepresentativePowers *map[ValidatorID]uint
Params *[]Param
Expand Down Expand Up @@ -135,7 +135,7 @@ func (tr TestRun) getChainState(chain ChainID, modelState ChainState) ChainState

if modelState.ProposedConsumerChains != nil {
proposedConsumerChains := tr.getProposedConsumerChains(chain)
chainState.ProposedConsumerChains = proposedConsumerChains
chainState.ProposedConsumerChains = &proposedConsumerChains
}

if modelState.ValPowers != nil {
Expand Down Expand Up @@ -780,9 +780,9 @@ func (tr TestRun) curlJsonRPCRequest(method, params, address string) {
}


Check failure on line 782 in tests/e2e/state.go

View workflow job for this annotation

GitHub Actions / lint

File is not `gci`-ed with --skip-generated -s standard -s default -s blank -s dot -s prefix(cosmossdk.io) -s prefix(github.com/cosmos/cosmos-sdk) -s prefix(github.com/cometbft/cometbft) -s prefix(github.com/cosmos/interchain-security) --custom-order (gci)
func (tr TestRun) getProposedConsumerChains(chain chainID) []string {
bz, err := exec.Command("docker", "exec", tr.containerConfig.instanceName, tr.chainConfigs[chain].binaryName,

func (tr TestRun) getProposedConsumerChains(chain ChainID) []string {
tr.waitBlocks(chain, 1, 10*time.Second)
bz, err := exec.Command("docker", "exec", tr.containerConfig.InstanceName, tr.chainConfigs[chain].BinaryName,
"query", "provider", "list-proposed-consumer-chains",
`--node`, tr.getQueryNode(chain),
`-o`, `json`,
Expand Down
10 changes: 4 additions & 6 deletions tests/e2e/steps_start_chains.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ func stepStartProviderChain() []Step {
ValidatorID("bob"): 9500000000,
ValidatorID("carol"): 9500000000,
},
ProposedConsumerChains: []string{},
},
},
},
Expand Down Expand Up @@ -55,7 +54,7 @@ func stepsStartConsumerChain(consumerName string, proposalIndex, chainIndex uint
Status: "PROPOSAL_STATUS_VOTING_PERIOD",
},
},
ProposedConsumerChains: []string{consumerName},
ProposedConsumerChains: &[]string{consumerName},
},
},
},
Expand Down Expand Up @@ -135,10 +134,9 @@ func stepsStartConsumerChain(consumerName string, proposalIndex, chainIndex uint
Status: "PROPOSAL_STATUS_PASSED",
},
},
ProposedConsumerChains: []string{},
ValBalances: &map[validatorID]uint{
validatorID("alice"): 9500000000,
validatorID("bob"): 9500000000,
ValBalances: &map[ValidatorID]uint{
ValidatorID("alice"): 9500000000,
ValidatorID("bob"): 9500000000,
},
},
},
Expand Down

0 comments on commit 27daf3a

Please sign in to comment.