Skip to content

Support checking for events in E2E Tests #1765

Open

Description

Summary

We should be able to verify the occurrence of events in our E2E tests give more flexibility in our assertions.

Problem Definition

Proposal

We should be able to add something like this to the E2ETestSuite use use the existing sdk QueryTxsByEvents function.

import authtx "github.com/cosmos/cosmos-sdk/x/auth/tx"

func (s *E2ETestSuite) QueryTxByEvents(ctx context.Context, chain *cosmos.CosmosChain, user broadcast.User, events ...string) (*sdk.SearchTxsResult, error) {
	b := cosmos.NewBroadcaster(s.T(), chain)
	cc, err := b.GetClientContext(ctx, user)
	if err != nil {
		return nil, err
	}
	return authtx.QueryTxsByEvents(cc, events, 1, 10000, "asc")
}

For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged/assigned
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions