interchaintest
interchaintest copied to clipboard
Feature Request: Add functionality to wait for events
Currently we have functionality to wait for a number of blocks as a mechanism to account for delay of certain operations to be seen by the test.
It would be useful to be able to listen for events and wait specific ones to be emitted.
// incentivise packet
err := events.WaitFor(chainA, feetypes.EventTypeIncentivizedPacket, timeOut)
require.NoError(t, err)
// continue with test
This request is specific only to tendermint-based chains. I feel we need to further discuss the inclusion of tendermint/cosmos vs other chains. I think it warrants a refactor to break apart the large ibc.Chain
interface. It may also mean a refactor (or removal) of our factories so we can deal with concrete types.
Additionally, one could make the case ibctest is focused on cosmos/tendermint. Therefore, we "punt" on worrying about other chains. We would gain speed here at the risk of creating large tech debt if/when non-tendermint chains truly enter the picture.
This is now possible with the BlockPoller
. See here for an example:
https://github.com/strangelove-ventures/interchaintest/blob/cc5bb34eeea5c54164eb361b595b754df037590a/testutil/poll_for_state.go#L63
Closing ticket.