stacks-network / clarity-wasm

`clar2wasm` is a compiler for generating WebAssembly from Clarity.
GNU General Public License v3.0
12 stars 9 forks source link

Fix constants definition #410

Closed Acaccia closed 1 month ago

Acaccia commented 1 month ago

While working on #370, I noticed an incoherence in the definition of constants. An in-memory type could have different representations depending on if its definition is from a literal or not.

This PR fixes the problem.

It also adds property tests for constants definition and retrieval.

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 89.18919% with 4 lines in your changes are missing coverage. Please review.

Project coverage is 87.30%. Comparing base (01cc29b) to head (267af3b).

Files Patch % Lines
clar2wasm/src/words/constants.rs 91.42% 0 Missing and 3 partials :warning:
clar2wasm/src/wasm_generator.rs 50.00% 0 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #410 +/- ## ========================================== + Coverage 87.28% 87.30% +0.01% ========================================== Files 43 43 Lines 18788 18803 +15 Branches 18788 18803 +15 ========================================== + Hits 16400 16416 +16 + Misses 1050 1049 -1 Partials 1338 1338 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.