Skip to content
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

feat: implement isClarityType #1597

Merged
merged 3 commits into from
Dec 14, 2023
Merged

feat: implement isClarityType #1597

merged 3 commits into from
Dec 14, 2023

Conversation

hugocaillard
Copy link
Contributor

@hugocaillard hugocaillard commented Nov 24, 2023

This PR was published to npm with the version 6.9.1-pr.649c54e.0
e.g. npm install @stacks/[email protected] --save-exact

Description

Implement a simple helper to narrow down the type of generic ClarityValues

Not sure about the naming. I'm open to suggestions

Breaking change?

/

Example

Provided in the code


Checklist

Copy link

vercel bot commented Nov 24, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
stacksjs-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 27, 2023 1:05pm

Copy link

codecov bot commented Nov 24, 2023

Codecov Report

Attention: 6 lines in your changes are missing coverage. Please review.

Comparison is base (debeb00) 66.18% compared to head (649c54e) 66.30%.
Report is 31 commits behind head on main.

Files Patch % Lines
packages/transactions/src/clarity/prettyPrint.ts 93.33% 3 Missing ⚠️
packages/transactions/src/cl.ts 60.00% 2 Missing ⚠️
packages/transactions/src/transaction.ts 87.50% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1597      +/-   ##
==========================================
+ Coverage   66.18%   66.30%   +0.12%     
==========================================
  Files         118      119       +1     
  Lines        8640     8677      +37     
  Branches     1908     1908              
==========================================
+ Hits         5718     5753      +35     
- Misses       2685     2799     +114     
+ Partials      237      125     -112     

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

Copy link
Collaborator

@janniks janniks left a comment

Choose a reason for hiding this comment

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

Nice, thanks 🙏

packages/transactions/src/clarity/clarityValue.ts Outdated Show resolved Hide resolved

assert(isClarityType(vInt, ClarityType.Int));
const intTest: IntCV = vInt;
intTest; // avoid the "value is never read warning"
Copy link
Collaborator

Choose a reason for hiding this comment

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

👏

@janniks janniks merged commit 25b3994 into main Dec 14, 2023
10 checks passed
@janniks janniks deleted the feat/is-cv-with-type branch December 14, 2023 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants