-
Notifications
You must be signed in to change notification settings - Fork 86
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
[gh-2385] add dry run check for run_function.rs. #2458
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
crates/rooch/build.rs
Outdated
|
||
fn read_proxy_from_env() { | ||
println!("cargo:rerun-if-env-changed=https_proxy"); | ||
println!("cargo:rerun-if-env-changed=all_proxy"); | ||
} |
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.
Not about this feature.
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.
Not about this feature.
Sorry I committed wrong.
@@ -36,6 +36,11 @@ pub struct RequestCommand { | |||
#[async_trait] | |||
impl CommandAction<serde_json::Value> for RequestCommand { | |||
async fn execute(self) -> RoochResult<serde_json::Value> { | |||
let https_proxy = env::var("https_proxy").ok(); |
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.
Not about this feature
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.
Not about this feature
Sorry I committed wrong.
@@ -81,15 +83,24 @@ impl CommandAction<ExecuteTransactionResponseView> for RunFunction { | |||
}) | |||
.collect::<Result<Vec<_>>>()?; | |||
let action = MoveAction::new_function_call(function_id, type_args, args); | |||
match (self.tx_options.authenticator, self.tx_options.session_key) { | |||
|
|||
let dry_run_result = context |
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.
If the dry_run_result
is an error, we should return the result and not try to execute the tx.
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.
If the
dry_run_result
is an error, we should return the result and not try to execute the tx.
I have dong returning the error before giving the status result.
if dry_run_result.raw_output.status != KeptVMStatusView::Executed { | ||
result.error_info = Some(dry_run_result); | ||
} |
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.
Put this check before execute(tx)
, or skip execute(tx) if dry_run_result is not KeptVMStatusView::Executed.
If the dry run result is not Executed, we should not try to execute it.
The publish command also has this mistake. cc @steelgeek091
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.
Put this check before
execute(tx)
, or skip execute(tx) if dry_run_result is not KeptVMStatusView::Executed.If the dry run result is not Executed, we should not try to execute it.
The publish command also has this mistake. cc @steelgeek091
Shall I fix them together or submit another PR to fix this issue only?
I merge this first. |
Summary
Add dry run check for
run_function.rs
.