Skip to content

Commit

Permalink
fix: rollabck changes from consumer ids to cahin ids
Browse files Browse the repository at this point in the history
  • Loading branch information
RafilxTenfen committed Sep 2, 2024
1 parent 0906422 commit a36c5ba
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 17 deletions.
21 changes: 6 additions & 15 deletions test/e2e/btc_timestamping_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,19 +112,10 @@ func (s *BTCTimestampingTestSuite) Test4IbcCheckpointing() {
nonValidatorNode, err := chainA.GetNodeAtIndex(2)
s.NoError(err)

// Query open IBC channels and assert there is only one
channels, err := nonValidatorNode.QueryIBCChannels()
s.NoError(err)
s.Equal(1, len(channels.Channels), "Expected only one open IBC channel")
// Get the client ID under this IBC channel
channelClientState, err := nonValidatorNode.QueryChannelClientState(channels.Channels[0].ChannelId, channels.Channels[0].PortId)
s.NoError(err)
clientID := channelClientState.IdentifiedClientState.ClientId

// Query checkpoint chain info for opposing chain
chainsInfo, err := nonValidatorNode.QueryChainsInfo([]string{clientID})
chainsInfo, err := nonValidatorNode.QueryChainsInfo([]string{initialization.ChainBID})
s.NoError(err)
s.Equal(chainsInfo[0].ChainId, clientID)
s.Equal(chainsInfo[0].ChainId, initialization.ChainBID)

// Finalize epoch 1, 2, 3, as first headers of opposing chain are in epoch 3
var (
Expand All @@ -149,17 +140,17 @@ func (s *BTCTimestampingTestSuite) Test4IbcCheckpointing() {
nonValidatorNode.WaitForNextBlock()

// Check we have epoch info for opposing chain and some basic assertions
epochChainsInfo, err := nonValidatorNode.QueryEpochChainsInfo(endEpochNum, []string{clientID})
epochChainsInfo, err := nonValidatorNode.QueryEpochChainsInfo(endEpochNum, []string{initialization.ChainBID})
s.NoError(err)
s.Equal(epochChainsInfo[0].ChainId, clientID)
s.Equal(epochChainsInfo[0].ChainId, initialization.ChainBID)
s.Equal(epochChainsInfo[0].LatestHeader.BabylonEpoch, endEpochNum)

// Check we have finalized epoch info for opposing chain and some basic assertions
finalizedChainsInfo, err := nonValidatorNode.QueryFinalizedChainsInfo([]string{clientID})
finalizedChainsInfo, err := nonValidatorNode.QueryFinalizedChainsInfo([]string{initialization.ChainBID})
s.NoError(err)

// TODO Add more assertion here. Maybe check proofs ?
s.Equal(finalizedChainsInfo[0].FinalizedChainInfo.ChainId, clientID)
s.Equal(finalizedChainsInfo[0].FinalizedChainInfo.ChainId, initialization.ChainBID)
s.Equal(finalizedChainsInfo[0].EpochInfo.EpochNumber, endEpochNum)

currEpoch, err := nonValidatorNode.QueryCurrentEpoch()
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/configurer/chain/queries.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ func (n *NodeConfig) QueryListHeaders(consumerID string, pagination *query.PageR
func (n *NodeConfig) QueryFinalizedChainsInfo(consumerIDs []string) ([]*zctypes.FinalizedChainInfo, error) {
queryParams := url.Values{}
for _, consumerID := range consumerIDs {
queryParams.Add("consumer_ids", consumerID)
queryParams.Add("chain_ids", consumerID)
}

bz, err := n.QueryGRPCGateway("babylon/zoneconcierge/v1/finalized_chains_info", queryParams)
Expand All @@ -285,7 +285,7 @@ func (n *NodeConfig) QueryEpochChainsInfo(epochNum uint64, consumerIDs []string)
queryParams := url.Values{}
for _, consumerID := range consumerIDs {
queryParams.Add("epoch_num", fmt.Sprintf("%d", epochNum))
queryParams.Add("consumer_ids", consumerID)
queryParams.Add("chain_ids", consumerID)
}

bz, err := n.QueryGRPCGateway("babylon/zoneconcierge/v1/epoch_chains_info", queryParams)
Expand Down

0 comments on commit a36c5ba

Please sign in to comment.