Skip to content

[clarity-wasm-tests] fix Unchecked(TypeError(UIntType, IntType)) #6204

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: feat/clarity-wasm-develop
Choose a base branch
from

Conversation

csgui
Copy link

@csgui csgui commented Jun 16, 2025

@csgui csgui requested a review from a team as a code owner June 16, 2025 16:59
Copy link

codecov bot commented Jun 16, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 20.49%. Comparing base (703f050) to head (30d4ade).
Report is 1 commits behind head on feat/clarity-wasm-develop.

❌ Your project check has failed because the head coverage (20.49%) is below the target coverage (80.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files
@@                      Coverage Diff                      @@
##           feat/clarity-wasm-develop    #6204      +/-   ##
=============================================================
- Coverage                      20.51%   20.49%   -0.02%     
=============================================================
  Files                            528      528              
  Lines                         392169   392169              
  Branches                         323      323              
=============================================================
- Hits                           80438    80387      -51     
- Misses                        311723   311774      +51     
  Partials                           8        8              
Files with missing lines Coverage Δ
clarity/src/vm/tests/contracts.rs 0.00% <ø> (ø)

... and 22 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6199c72...30d4ade. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

@Acaccia Acaccia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Too much code duplication. We should instead just assign expected value to a if cfg!(clarity-wasm) {...} else {...}.

Comment on lines 101 to 108
let contracts = [
"(define-private (test-func) (get-block-info? time u1))",
"(define-private (test-func) (get-block-info? time block-height))",
"(define-private (test-func) (get-block-info? time u100000))",
"(define-private (test-func) (get-block-info? header-hash u1))",
"(define-private (test-func) (get-block-info? burnchain-header-hash u1))",
"(define-private (test-func) (get-block-info? vrf-seed u1))",
];
Copy link
Contributor

@Acaccia Acaccia Jun 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are there only 6 contracts compared to the 8 in the regular test?

Copy link
Author

@csgui csgui Jun 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two of them would fail during the Clarity-wasm static analysis pass, but the other six make sense to be validated in a test.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we also get testable errors in this case?

Copy link
Author

@csgui csgui Jun 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is possible, but that would require considerable changes in the code, that is not our intention when dealing with tests.

@csgui csgui requested review from Acaccia and BowTiedWoo June 17, 2025 13:11
Copy link
Contributor

@Acaccia Acaccia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I would here argue that the test wasn't very pretty to begin with. How about a refactor which would make it a lot prettier: instead of having two variables with contracts and expected, we could have a single list of tuple (contract, expected). This way, we have no problem using our if cfg!..., and the testing loop can stop using an index and iterate directly for (contract, expected) in list_of_stuffs {...}.

@csgui csgui force-pushed the wasm-issue-677/unchecked-type-error branch from ff4e695 to f410a1a Compare June 17, 2025 20:35
@csgui csgui requested a review from Acaccia June 17, 2025 20:36
@csgui csgui force-pushed the wasm-issue-677/unchecked-type-error branch from f410a1a to 83a58de Compare June 17, 2025 20:37
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