fix: flaky ownershipTransfer e2e test#83
Merged
Merged
Conversation
- Fixes expectUserOperationToSucceed parameter type - Fixes expectUserOperationToSucceed to actually execute toBeTruthy assertion - Fixes call to expectUserOperationToSucceed in flaky test to pass UserOperationReceipt rather than UserOperationHash
d7293e9 to
c83f223
Compare
hanzel98
approved these changes
Oct 13, 2025
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.
📝 Description
The
ownershipTransfere2e tests were incorrectly passing the useroperation hash to theexpectUserOperationToSucceedfunction, that actually expects a parameter of typeUserOperationReceipt.This assertion function was then ensuring that the
receipt.successis true - but the assertion was not being executed.This resulted in two problems:
ownershipTransfere2e tests never awaited the receipt🔄 What Changed?
expectUserOperationToSucceedparameter typeexpectUserOperationToSucceedto actually executetoBeTruthyassertionexpectUserOperationToSucceedin flaky test to passUserOperationReceiptrather thanUserOperationHash🧪 How to Test?
E2E tests should pass
🔗 Related Issues
Link to related issues:
Closes #
Related to #
📚 Additional Notes
Any additional information, concerns, or context:
Note
Ownership transfer e2e tests now wait for the user operation receipt and pass it to the assertion, which is updated to use viem’s UserOperationReceipt and correctly invoke toBeTruthy().
packages/delegator-e2e/test/caveats/ownershipTransfer.test.ts):UserOperationReceiptviawaitForUserOperationReceipt({ hash })and pass the receipt toexpectUserOperationToSucceed(replacing directuserOpHash).packages/delegator-e2e/test/utils/assertions.ts):expectUserOperationToSucceedparam type toviem/account-abstractionUserOperationReceipt.toBeTruthy().UserOperationReceiptResponseimport from@metamask/delegation-toolkit.Written by Cursor Bugbot for commit c83f223. This will update automatically on new commits. Configure here.