Skip to content

Commit

Permalink
fix: update testconfig to use revision formatted chainIDs (cosmos#4630)
Browse files Browse the repository at this point in the history
  • Loading branch information
charleenfei committed Sep 19, 2023
1 parent 10c4a02 commit 105e0bc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions e2e/sample.config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
---
chains:
# the entry at index 0 corresponds to CHAIN_A
- chainId: chain-a
- chainId: chainA-1
numValidators: 1
numFullNodes: 0
image: ghcr.io/cosmos/ibc-go-simd # override with CHAIN_IMAGE
tag: main # override with CHAIN_A_TAG
binary: simd # override with CHAIN_BINARY

# the entry at index 1 corresponds to CHAIN_B
- chainId: chain-b
- chainId: chainB-1
numValidators: 1
numFullNodes: 0
image: ghcr.io/cosmos/ibc-go-simd # override with CHAIN_IMAGE
Expand Down
4 changes: 2 additions & 2 deletions e2e/tests/core/02-client/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ func (s *ClientTestSuite) TestScheduleIBCUpgrade_Succeeds() {
s.Require().NoError(err)

originalChainID := clientState.(*ibctm.ClientState).ChainId
revisionNumber := clienttypes.ParseChainID(fmt.Sprintf("%s-%d", originalChainID, 1))
revisionNumber := clienttypes.ParseChainID(originalChainID)
// increment revision number even with new chain ID to prevent loss of misbehaviour detection support
newChainID, err = clienttypes.SetRevisionNumber(fmt.Sprintf("%s-%d", originalChainID, 1), revisionNumber+1)
newChainID, err = clienttypes.SetRevisionNumber(originalChainID, revisionNumber+1)
s.Require().NoError(err)
s.Require().NotEqual(originalChainID, newChainID)

Expand Down
4 changes: 2 additions & 2 deletions e2e/testsuite/testconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,15 @@ func (tc TestConfig) GetChainAID() string {
if tc.ChainConfigs[0].ChainID != "" {
return tc.ChainConfigs[0].ChainID
}
return "chain-a"
return "chainA-1"
}

// GetChainBID returns the chain-id for chain B.
func (tc TestConfig) GetChainBID() string {
if tc.ChainConfigs[1].ChainID != "" {
return tc.ChainConfigs[1].ChainID
}
return "chain-b"
return "chainB-1"
}

// UpgradeConfig holds values relevant to upgrade tests.
Expand Down

0 comments on commit 105e0bc

Please sign in to comment.