Skip to content

Commit

Permalink
fix: BTCTimestampingTestSuite
Browse files Browse the repository at this point in the history
  • Loading branch information
RafilxTenfen committed Sep 2, 2024
1 parent e16f735 commit 4f4fa69
Showing 1 changed file with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions test/e2e/btc_timestamping_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ func (s *BTCTimestampingTestSuite) SetupSuite() {
// 3. Run IBC relayer between the two chains.
// 4. Execute various e2e tests, including IBC
s.configurer, err = configurer.NewBTCTimestampingConfigurer(s.T(), true)

s.Require().NoError(err)

err = s.configurer.ConfigureChains()
Expand All @@ -50,7 +49,9 @@ func (s *BTCTimestampingTestSuite) SetupSuite() {

func (s *BTCTimestampingTestSuite) TearDownSuite() {
err := s.configurer.ClearResources()
s.Require().NoError(err)
if err != nil {
s.T().Logf("error to clear resources %s", err.Error())
}
}

// Most simple test, just checking that two chains are up and connected through
Expand Down Expand Up @@ -111,10 +112,19 @@ 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{initialization.ChainBID})
chainsInfo, err := nonValidatorNode.QueryChainsInfo([]string{clientID})
s.NoError(err)
s.Equal(chainsInfo[0].ChainId, initialization.ChainBID)
s.Equal(chainsInfo[0].ConsumerId, clientID)

Check failure on line 127 in test/e2e/btc_timestamping_e2e_test.go

View workflow job for this annotation

GitHub Actions / lint_test / integration-tests

chainsInfo[0].ConsumerId undefined (type *"github.com/babylonlabs-io/babylon/x/zoneconcierge/types".ChainInfo has no field or method ConsumerId)

Check failure on line 127 in test/e2e/btc_timestamping_e2e_test.go

View workflow job for this annotation

GitHub Actions / lint_test / lint

chainsInfo[0].ConsumerId undefined (type *"github.com/babylonlabs-io/babylon/x/zoneconcierge/types".ChainInfo has no field or method ConsumerId)

Check failure on line 127 in test/e2e/btc_timestamping_e2e_test.go

View workflow job for this annotation

GitHub Actions / lint_test / unit-tests

chainsInfo[0].ConsumerId undefined (type *"github.com/babylonlabs-io/babylon/x/zoneconcierge/types".ChainInfo has no field or method ConsumerId)

// Finalize epoch 1, 2, 3, as first headers of opposing chain are in epoch 3
var (
Expand All @@ -139,17 +149,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{initialization.ChainBID})
epochChainsInfo, err := nonValidatorNode.QueryEpochChainsInfo(endEpochNum, []string{clientID})
s.NoError(err)
s.Equal(epochChainsInfo[0].ChainId, initialization.ChainBID)
s.Equal(epochChainsInfo[0].ConsumerId, clientID)

Check failure on line 154 in test/e2e/btc_timestamping_e2e_test.go

View workflow job for this annotation

GitHub Actions / lint_test / integration-tests

epochChainsInfo[0].ConsumerId undefined (type *"github.com/babylonlabs-io/babylon/x/zoneconcierge/types".ChainInfo has no field or method ConsumerId)

Check failure on line 154 in test/e2e/btc_timestamping_e2e_test.go

View workflow job for this annotation

GitHub Actions / lint_test / lint

epochChainsInfo[0].ConsumerId undefined (type *"github.com/babylonlabs-io/babylon/x/zoneconcierge/types".ChainInfo has no field or method ConsumerId)

Check failure on line 154 in test/e2e/btc_timestamping_e2e_test.go

View workflow job for this annotation

GitHub Actions / lint_test / unit-tests

epochChainsInfo[0].ConsumerId undefined (type *"github.com/babylonlabs-io/babylon/x/zoneconcierge/types".ChainInfo has no field or method ConsumerId)
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{initialization.ChainBID})
finalizedChainsInfo, err := nonValidatorNode.QueryFinalizedChainsInfo([]string{clientID})
s.NoError(err)

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

Check failure on line 162 in test/e2e/btc_timestamping_e2e_test.go

View workflow job for this annotation

GitHub Actions / lint_test / integration-tests

finalizedChainsInfo[0].FinalizedChainInfo.ConsumerId undefined (type *"github.com/babylonlabs-io/babylon/x/zoneconcierge/types".ChainInfo has no field or method ConsumerId)

Check failure on line 162 in test/e2e/btc_timestamping_e2e_test.go

View workflow job for this annotation

GitHub Actions / lint_test / lint

finalizedChainsInfo[0].FinalizedChainInfo.ConsumerId undefined (type *"github.com/babylonlabs-io/babylon/x/zoneconcierge/types".ChainInfo has no field or method ConsumerId) (typecheck)

Check failure on line 162 in test/e2e/btc_timestamping_e2e_test.go

View workflow job for this annotation

GitHub Actions / lint_test / unit-tests

finalizedChainsInfo[0].FinalizedChainInfo.ConsumerId undefined (type *"github.com/babylonlabs-io/babylon/x/zoneconcierge/types".ChainInfo has no field or method ConsumerId)
s.Equal(finalizedChainsInfo[0].EpochInfo.EpochNumber, endEpochNum)

currEpoch, err := nonValidatorNode.QueryCurrentEpoch()
Expand Down

0 comments on commit 4f4fa69

Please sign in to comment.