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/clarity cli execute json #2587

Closed
wants to merge 1 commit into from
Closed

Conversation

hstove
Copy link
Contributor

@hstove hstove commented Apr 13, 2021

Description

This PR implements some functionality that I've been using to develop a tool for running running Clarity tests in a JS environment. It's built on top of clarity-js-sdk, but it uses the raw Clarity hex result of different contract interactions. This allows for more robust handling of contracts, without having to write a parser for Clarity output.

It adds two new commands to the clarity-cli CLI:

  • eval_at_chaintip_json: just like eval_at_chaintip, but it returns a JSON-serialized output to stdout, with a field for the raw Clarity hex result
  • execute_json: like execute, but it returns JSON to stdout, along with the raw Clarity hex result

Type of Change

  • New feature
  • Bug fix
  • API reference/documentation update
  • Other

@hstove hstove changed the base branch from master to develop April 13, 2021 00:45
@jcnelson
Copy link
Member

While I agree that clarity_cli would be improved by printing out a machine-readable result, I don't think this is best achieved by adding new commands. Instead, I think the invoke_command function should simply return the data to be displayed -- either a serde::Value or a Vec<String> -- based on the presence or absence of a --json flag. I'm already working on this.

jcnelson added a commit that referenced this pull request Apr 20, 2021
…nally report runtime costs and asset movements, and will output everything in JSON
@jcnelson
Copy link
Member

jcnelson commented May 3, 2021

Going to go ahead and close this -- #2597 supersedes it.

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