Skip to content

chore: unify ChainflipIO api interface#6372

Open
MxmUrw wants to merge 6 commits intomainfrom
chore/unify-chainflip-io-api-interface
Open

chore: unify ChainflipIO api interface#6372
MxmUrw wants to merge 6 commits intomainfrom
chore/unify-chainflip-io-api-interface

Conversation

@MxmUrw
Copy link
Contributor

@MxmUrw MxmUrw commented Jan 21, 2026

Pull Request

Part of PRO-2549

Checklist

Please conduct a thorough self-review before opening the PR.

  • I am confident that the code works.
  • I have written sufficient tests.
  • I have written and tested required migrations.
  • I have updated documentation where appropriate.

Summary

This PR unifies how cf methods deal with an expectedEvent argument. The functions that can take such an argument are stepToTransactionIncluded, submitGovernance, submitExtrinsic. They are all implemented in two steps:

  1. A helper method called e.g. impl_submitGovernance is implemented. It contains the actual logic. It's return type is Promise<EventFilter>.
  2. The actual submitGovernance is automatically derived with the help of cf.wrapWithExpectEvent. This handles the expectedEvent argument and combines it with the event filter returned by the function being wrapped, before passing them to cf.expectEvent.

The visible API change is that now cf.expectEvent takes arg: {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 cf methods are defined, the EventDescription struct now takes a Schema extends z.ZodTypeAny argument. This makes the method declarations a bit easier to read while preserving type inference.

@codecov
Copy link

codecov bot commented Jan 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Base automatically changed from chore/smaller-chainflip-io-fixes to main January 26, 2026 10:17
@MxmUrw MxmUrw force-pushed the chore/unify-chainflip-io-api-interface branch 2 times, most recently from 2a4176a to 5d76d48 Compare January 28, 2026 15:23
@MxmUrw MxmUrw marked this pull request as ready for review January 28, 2026 15:42
@MxmUrw MxmUrw requested a review from albert-llimos as a code owner January 28, 2026 15:42
@MxmUrw MxmUrw requested a review from dandanlen January 28, 2026 15:42
@MxmUrw MxmUrw enabled auto-merge January 29, 2026 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants