-
Notifications
You must be signed in to change notification settings - Fork 11.3k
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
Add sui-move CLI #444
Add sui-move CLI #444
Conversation
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.
Some comments on unwraps, otherwise LGTM.
I think we need a UX expert to tell us which is better, 1 binary vs many binaries
sui/src/sui-move.rs
Outdated
} | ||
|
||
#[tokio::main] | ||
async fn main() -> Result<(), anyhow::Error> { |
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.
nit: async not needed here?
@@ -36,7 +35,7 @@ pub enum EventType { | |||
|
|||
pub fn get_sui_framework_modules() -> Vec<CompiledModule> { | |||
let modules = build_framework("."); | |||
verify_modules(&modules); | |||
verify_modules(&modules).unwrap(); |
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.
will this panic?
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.
It would. This logic doesn't change (it would panic before). Since it's part of loading genesis, it should be ok. (we could certainly consider improve it)
@@ -50,7 +49,7 @@ pub fn get_move_stdlib_modules() -> Vec<CompiledModule> { | |||
.into_iter() | |||
.filter(|m| !denylist.contains(&m.self_id().name().to_owned())) | |||
.collect(); | |||
verify_modules(&modules); | |||
verify_modules(&modules).unwrap(); |
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.
ditto
I'm a fan of one CLI but it might make sense to keep this separate since for rapid dev and migrate stable features to the main stable CLI as needed. |
e3f319b
to
688e1de
Compare
a4adf92
to
e6900f1
Compare
e6900f1
to
f45e5b2
Compare
On one CLI vs multiple: I think because the main Sui CLI is an interactive shell, it probably makes sense to have a separate CLI for Move dev (which doesn't require the context/state that the interactive shell buys you). However, I think we should make most (or all) of the Move CLI commands usable from the main Sui CLI as well so it can be a one stop shop. This is easy to do in Rust with structopt subcommands + I often look at dapptools for inspiration on how to design these separate CLI's that interact with each other. They seem to have a pretty clean division of local dev, network interaction, and signing CLI's https://github.com/dapphub/dapptools based on a lot of experience with Eth. I'm sure there will be some differences because of Move vs EVM and Sui vs Eth, but still useful. |
.map_err(|err| SuiError::MoveUnitTestFailure { | ||
error: err.to_string(), | ||
})?; | ||
if result == UnitTestResult::Failure { |
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'm confused about when we will take this branch vs returning a result via the error + ?
at 190--do you have a good understanding of this?
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.
My understanding is that it's similar to how we use Result. If the test didn't even run due to issues like invalid test graph/dependency, it fails with Err. Otherwise if it's test failure it's Ok(Fail).
Add sui-move CLI that allows a Move application developer to build and test their code.
I could also merge this into
sui
CLI.Open to feedback / suggestions.