Skip to content

test: reactivate the Warning enum unwrap assertion in the typed test - #1715

Merged
PhilippeR26 merged 1 commit into
starknet-io:developfrom
PhilippeR26:test/typedTests
Sep 25, 2026
Merged

PhilippeR26 merged 1 commit into
starknet-io:developfrom
PhilippeR26:test/typedTests

Conversation

@PhilippeR26

Copy link
Copy Markdown
Collaborator

Motivation and Resolution

In __tests__/cairo1v2_typed.test.ts, the CairoEnums test had a commented-out assertion on my_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 in cairo1v2.test.ts stayed active.

The assumption that typing changes what unwrap() returns does not hold: typedv2() is a plain cast (this as unknown as TypedContractV2<…>) and unwrap() returns any. The typed contract behaves exactly like the untyped one.

The assertion is reactivated and migrated to CairoBytes31.fromText('attention:100').toBigInt(), like its twin in cairo1v2.test.ts. It passes against devnet in both the HTTP and WebSocket Jest projects.

RPC version (if applicable)

N/A

Usage related changes

  • None.

Development related changes

  • The CairoEnums test of cairo1v2_typed.test.ts checks the value of the Warning variant again, not only its name, and matches cairo1v2.test.ts on this test.

Checklist:

  • Performed a self-review of the code
  • Rebased to the last commit of the target branch (or merged it into my branch)
  • Updated the tests
  • All tests are passing

… 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.
@PhilippeR26
PhilippeR26 merged commit 3e087e7 into starknet-io:develop Sep 25, 2026
7 checks passed
@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 11.0.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant