We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
It would be really great if script return values could be serialized into Cadence json and saved locally.
A flag added to flow scripts ... like --serialize-to <FILENAME.json>. Say I have a script like:
flow scripts ...
--serialize-to <FILENAME.json>
access(all) fun main(): UInt64 { return getCurrentBlock().height }
That I run with the command:
flow scripts execute ./scripts/get_current_block_height.cdc --serialize-to block-height.json
Where block-height.json looks like
block-height.json
[ { "type": "UInt64", "value": "70027781" } ]
This would allow me to script the following:
#!/bin/bash flow scripts execute ./scripts/get_current_block_height.cdc --serialize-to block-height.json flow transactions execute ./transactions/set_minimum_block_height.cdc --args-json "$(cat block-height.json)"
Where the script result is used as args for the subsequent transaction execution.
Not a blocker, just an idea.
The text was updated successfully, but these errors were encountered:
does -o json > file.json do what you want?
-o json > file.json
Sorry, something went wrong.
I guess that returns it without the surrounding array wrapper.
This is not cli, but this little snippet of overflow does the same
var height uint64 o.Script("get_current_block").MarshalAs(&height) o.Tx("set_minimum_block_height", overflow.WithSigner("foo"), overflow.WithArg("height", height))
No branches or pull requests
Issue To Be Solved
It would be really great if script return values could be serialized into Cadence json and saved locally.
Suggest A Solution
A flag added to
flow scripts ...
like--serialize-to <FILENAME.json>
. Say I have a script like:That I run with the command:
Where
block-height.json
looks likeThis would allow me to script the following:
Where the script result is used as args for the subsequent transaction execution.
Context
Not a blocker, just an idea.
The text was updated successfully, but these errors were encountered: