Skip to content

v0.13#370

Open
rkalis wants to merge 110 commits into
masterfrom
next
Open

v0.13#370
rkalis wants to merge 110 commits into
masterfrom
next

Conversation

@rkalis
Copy link
Copy Markdown
Member

@rkalis rkalis commented Oct 9, 2025

No description provided.

@vercel
Copy link
Copy Markdown

vercel Bot commented Oct 9, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cashscript Ready Ready Preview, Comment May 19, 2026 10:41am

Request Review

@codecov
Copy link
Copy Markdown

codecov Bot commented Oct 16, 2025

Codecov Report

❌ Patch coverage is 82.90094% with 145 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.26%. Comparing base (c8320cc) to head (1233d88).

Files with missing lines Patch % Lines
packages/utils/src/artifact.ts 2.77% 21 Missing and 14 partials ⚠️
.../cashscript/src/network/ElectrumNetworkProvider.ts 15.62% 19 Missing and 8 partials ⚠️
packages/cashscript/src/transaction-utils.ts 0.00% 20 Missing and 5 partials ⚠️
packages/cashscript/src/network/errors.ts 0.00% 12 Missing ⚠️
packages/utils/src/script.ts 27.27% 8 Missing ⚠️
packages/cashscript/src/Errors.ts 50.00% 6 Missing ⚠️
packages/cashc/src/ast/AstBuilder.ts 93.65% 3 Missing and 1 partial ⚠️
packages/utils/src/data.ts 33.33% 3 Missing and 1 partial ⚠️
packages/utils/src/fingerprint.ts 83.33% 4 Missing ⚠️
packages/utils/src/source-map.ts 63.63% 3 Missing and 1 partial ⚠️
... and 8 more

❌ Your patch check has failed because the patch coverage (82.90%) is below the target coverage (90.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #370      +/-   ##
==========================================
- Coverage   87.21%   86.26%   -0.95%     
==========================================
  Files          48       51       +3     
  Lines        3276     3895     +619     
  Branches      593      724     +131     
==========================================
+ Hits         2857     3360     +503     
- Misses        329      415      +86     
- Partials       90      120      +30     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 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.

return;
}

// TODO: Revisit this later, for now we allow loops to not have a require() at the end
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Do we need to do this before launch?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

On thursday we should try to craft an example of where this might matter.

@@ -0,0 +1,6 @@
contract IntToByte() {
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This test is marked as TODO still

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We should fix this on thursday.

Comment thread packages/utils/src/optimisations.ts
@rkalis
Copy link
Copy Markdown
Member Author

rkalis commented May 19, 2026

We noticed that if there is only a single function parameter (and it is having its type enforced), we are adding a redundant OP_DUP and OP_DROP. See this example:

                                           /* contract ParameterCheck() {                   */
                                           /*     function spend(                           */
                                           /*         bytes8 tag,                           */
                                           /*     ) {                                       */
OP_DUP OP_SIZE OP_8 OP_EQUALVERIFY OP_DROP /*         >>> parameter type check (bytes8 tag) */
OP_SIZE OP_NIP OP_8 OP_NUMEQUAL            /*         require(tag.length == 8);             */
                                           /*     }                                         */
                                           /* }                                             */

We either fix it with a special case, or we can choose to use OP_ROLL instead of OP_PICK, which reorders the parameters on the stack.

@mr-zwets
Copy link
Copy Markdown
Member

mr-zwets commented May 19, 2026

compiler docs are still missing the 2nd flag option

Compiler Options

interface CompilerOptions {
  enforceFunctionParameterTypes?: boolean;
}

and similarly in the release notes only has

🛠 Add compiler option to cashc (programmatic and CLI compilation) to allow for opting out of function parameter type enforcement.

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