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: call private function in simnet #1380

Merged
merged 11 commits into from
Mar 13, 2024

Conversation

hugocaillard
Copy link
Collaborator

@hugocaillard hugocaillard commented Mar 11, 2024

Fix: #547

Description

Allow to contract private functions from the simnet.
It requires the changes of this PR stacks-network/stacks-core#4520, which have been cherry-picked on feat/clarity-wasm-next.

call_contract_fn

In the interpreter, there's a new call_contract_fn method that can be used instead of run or execute to perform contract calls.
This method is slightly more performant (it doesn't build an virtual contract and has a better clarity args serialization logic).

This improved way to all contract functions is now used for callPublicFn and callReadOnlyFn as well


Checklist

  • Tests added in this PR (if applicable)

@hugocaillard hugocaillard force-pushed the feat/call-private-function-in-sdk branch from 06ad555 to 7b195bc Compare March 12, 2024 18:21
@hugocaillard hugocaillard marked this pull request as ready for review March 12, 2024 22:11
Copy link

codecov bot commented Mar 12, 2024

Codecov Report

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

Project coverage is 41.80%. Comparing base (dbc0178) to head (43e060f).

Files Patch % Lines
components/clarity-repl/src/repl/session.rs 0.00% 55 Missing ⚠️
components/clarity-repl/src/repl/interpreter.rs 87.04% 32 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1380      +/-   ##
==========================================
+ Coverage   41.38%   41.80%   +0.42%     
==========================================
  Files          87       88       +1     
  Lines       31993    32405     +412     
==========================================
+ Hits        13241    13548     +307     
- Misses      18752    18857     +105     

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

@hugocaillard hugocaillard enabled auto-merge (squash) March 13, 2024 16:49
@hugocaillard hugocaillard merged commit 0288a26 into main Mar 13, 2024
19 checks passed
@hugocaillard hugocaillard deleted the feat/call-private-function-in-sdk branch March 13, 2024 17:21
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.

Allow clarinet to access functions that are private (to enable unit testing)
2 participants