Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
…, schema)`. This makes it consistent with the other functions.
2a4176a to
5d76d48
Compare
dandanlen
approved these changes
Jan 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
Part of PRO-2549
Checklist
Please conduct a thorough self-review before opening the PR.
Summary
This PR unifies how cf methods deal with an
expectedEventargument. The functions that can take such an argument arestepToTransactionIncluded,submitGovernance,submitExtrinsic. They are all implemented in two steps:impl_submitGovernanceis implemented. It contains the actual logic. It's return type isPromise<EventFilter>.submitGovernanceis automatically derived with the help ofcf.wrapWithExpectEvent. This handles theexpectedEventargument and combines it with the event filter returned by the function being wrapped, before passing them tocf.expectEvent.The visible API change is that now
cf.expectEventtakesarg: {event, schema}as argument instead of taking event and schema as two separate arguments.There's also a change to how the input types of the
cfmethods are defined, theEventDescriptionstruct now takes aSchema extends z.ZodTypeAnyargument. This makes the method declarations a bit easier to read while preserving type inference.