Repository navigation
test: reactivate the Warning enum unwrap assertion in the typed test - #1715
Merged
Merged
Conversation
… 1 test The assertion was commented out when the abiwan-typed variant was created and never reactivated. typedv2() is a plain cast, so the typed contract behaves exactly like the untyped one and the assertion passes. It now mirrors cairo1v2.test.ts, migrated to CairoBytes31.
Contributor
|
🎉 This PR is included in version 11.0.3 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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.
Motivation and Resolution
In
__tests__/cairo1v2_typed.test.ts, theCairoEnumstest had a commented-out assertion onmy_enum_output(100).unwrap(). It was already commented out when the abiwan-typed variant was created (c35220e, 2023-12) and never reactivated, while the same assertion incairo1v2.test.tsstayed active.The assumption that typing changes what
unwrap()returns does not hold:typedv2()is a plain cast (this as unknown as TypedContractV2<…>) andunwrap()returnsany. The typed contract behaves exactly like the untyped one.The assertion is reactivated and migrated to
CairoBytes31.fromText('attention:100').toBigInt(), like its twin incairo1v2.test.ts. It passes against devnet in both the HTTP and WebSocket Jest projects.RPC version (if applicable)
N/A
Usage related changes
Development related changes
CairoEnumstest ofcairo1v2_typed.test.tschecks the value of theWarningvariant again, not only its name, and matchescairo1v2.test.tson this test.Checklist: