-
Notifications
You must be signed in to change notification settings - Fork 723
refactor: make clarity-cli to use clap #6720
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
base: develop
Are you sure you want to change the base?
refactor: make clarity-cli to use clap #6720
Conversation
Codecov Report❌ Patch coverage is
❌ Your project check has failed because the head coverage (63.26%) 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 @@
## develop #6720 +/- ##
============================================
- Coverage 77.90% 63.26% -14.64%
============================================
Files 580 580
Lines 361187 361351 +164
============================================
- Hits 281374 228626 -52748
- Misses 79813 132725 +52912
... and 367 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
|
stacks-core/contrib/clarity-cli/src/lib.rs Lines 438 to 493 in 90033c3
I noticed that I think we could either remove What do you think? If it makese sense, I'd tackle this in a separate PR. |
| @@ -471,6 +462,7 @@ pub fn vm_execute_in_epoch( | |||
| /// Execute program in a transient environment in the latest epoch. | |||
| /// To be used only by CLI tools for program evaluation, not by consensus | |||
| /// critical code. | |||
| /// TODO: Unused internally in the cli, but used in other functions - Shall we use vm_execute_in_epoch with StacksEpochId::latest() instead, so we can remove this function? | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this sounds good to me.
brice-stacks
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a great improvement. Just a couple minor comments.
| if mainnet { | ||
| ( | ||
| 0, | ||
| Some(json!({ | ||
| "message": "Database created.", | ||
| "network": "mainnet" | ||
| })), | ||
| ) | ||
| } else { | ||
| ClarityVersion::default_for_epoch(epoch) | ||
| ( | ||
| 0, | ||
| Some(json!({ | ||
| "message": "Database created.", | ||
| "network": "testnet" | ||
| })), | ||
| ) | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about flattening this to:
(
0,
Some(json!({
"message": "Database created.",
"network": if mainnet { "mainnet" } else { "testnet" }
})),
)| None | ||
| }; | ||
|
|
||
| // Run analysis and initialize contract in a new block? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| // Run analysis and initialize contract in a new block? | |
| // Run analysis and initialize contract in a new block |
Description
Refactors the clarity-cli command-line interface to use
clapfor argument parsing, replacing the previous manual argument handling.Applicable issues
clarity-clito useclap#6671Additional info (benefits, drawbacks, caveats)
Benefits:
Checklist
docs/rpc/openapi.yamlandrpc-endpoints.mdfor v2 endpoints,event-dispatcher.mdfor new events)clarity-benchmarkingrepo