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

fix issue 3703, add more validation and more error display #3722

Merged
merged 4 commits into from
Sep 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion cmd/starcoin/src/cli_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,10 @@ impl CliState {
TransactionStatusView::Executed
)
{
eprintln!("txn dry run result:");
eprintln!(
"txn dry run result: {:?}",
execute_result.dry_run_output.txn_output
);
return Ok(execute_result);
}

Expand Down
1 change: 1 addition & 0 deletions vm/move-package-manager/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ starcoin-types = {path = "../../types"}
starcoin-vm-runtime = {path = "../vm-runtime", features = ["testing"]}
starcoin-vm-types = {path = "../../vm/types"}
stdlib = {path = "../stdlib"}
vm-status-translator = {path = "../../vm/vm-status-translator"}

[dev-dependencies]

Expand Down
12 changes: 11 additions & 1 deletion vm/move-package-manager/src/deployment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ use starcoin_rpc_client::RpcClient;
use starcoin_vm_types::transaction::TransactionPayload;
use std::path::PathBuf;
use std::time::Duration;
use vm_status_translator::VmStatusExplainView;

#[derive(Parser)]
pub struct DeploymentCommand {
Expand Down Expand Up @@ -102,7 +103,16 @@ pub fn handle_deployment(_move_args: &Move, cmd: DeploymentCommand) -> anyhow::R
let item =
state.build_and_execute_transaction(cmd.txn_opts, TransactionPayload::Package(package));
match item {
Ok(_) => println!("The deployment is successful."),
Ok(execute_result_view) => {
// check dry run result
if VmStatusExplainView::Executed == execute_result_view.dry_run_output.explained_status
{
println!("The deployment is successful.");
} else {
println!("The deployment is failed. execute result view is: ");
println!("{:?}", execute_result_view);
}
}
Err(e) => {
println!("The deployment is failed. Reason: ");
println!("{:?}", e);
Expand Down