-
Notifications
You must be signed in to change notification settings - Fork 66
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
Execute FLIX scripts/transactions #1125
Conversation
I think using cobra and commands and flags would make this api better. It is also a lot easier to generate good help that way. flow-cli is modeled that way, any reason to change that? |
@bjartek fair point. I'm still getting familiar with Cobra. Is it possible to handle commands like the |
subcommands in cobra are seperate by space, so you could do i would personally also love to se a 'smart' command here The flix know if it is a transaction or a script. |
The first too are a little verbose. I like the simplicity of option three, |
@bjartek one more note: yeah we'll actually need to probably add |
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.
I think defining this command to use flags would be better. Example: flow flix --name hello
or flow flix --id 123
. The usage of flow flix id 123
or flow flix name hello
is nonconsistent with other commands. CLI never uses arguments to define the type of the next argument value. Also https://github.com/onflow/flow-cli/blob/master/CONTRIBUTING.md#arguments
I like the new command syntax. |
What should happen if you try to execute a flix that do not have updated pins? So say your flix relies on an old version of a contract pinned and you try to run it after it has been updated. should there be a prompt that tells the user "hey this flix is outdated" or "this flix is not verified" The same can be said if you want your flix to be verified by a validator. |
UPDATE: I wound up detecting if it's a path, name, or id and removed requirement to provided it as a command or as a flag (cc @sideninja ) Also, @bjartek I really like the prompt idea for the out of sync pins. Do you think that's fine to do in a separate issue? Doesn't seem required for this PR, right? Would be nice to close this one and start that separately since it would also require us adding the pinning logic to flixkit. Is Overflow's pin compute functions working fully or it requires flix to be updated to the new version that is more reliable for hashing with the array format? |
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.
Left comments, looks good but some things to address, also can you link a documentation PR to this one.
@sideninja Here is the docs PR: onflow/docs#182 |
Co-authored-by: Gregor G. <[email protected]>
Co-authored-by: Gregor G. <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #1125 +/- ##
==========================================
- Coverage 39.47% 38.31% -1.17%
==========================================
Files 37 38 +1
Lines 1882 1947 +65
==========================================
+ Hits 743 746 +3
- Misses 1051 1113 +62
Partials 88 88
Flags with carried forward coverage won't be shown. Click here to find out more.
|
@chasefleming let me know when you want another review |
@sideninja Ready for another review |
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.
Looks good, left couple of small comments
Closes #984
Execute FLIX by id, name, or path (detected by CLI):
flow flix multiply 2 3 --network testnet
flow flix bd10ab0bf472e6b58ecc0398e9b3d1bd58a4205f14a7099c52c0640d9589295f 2 3 --network testnet
flow flix ./multiply.template.json 2 3 --network testnet
Description
TODO:
For contributor use:
master
branchFiles changed
in the Github PR explorer