Skip to content

Commit

Permalink
fix: code style
Browse files Browse the repository at this point in the history
  • Loading branch information
qiweiii committed May 5, 2024
1 parent 057fd1a commit 4bb0d71
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions executor/src/task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,9 @@ pub async fn run_task(task: TaskCall, js: crate::JsCallback) -> Result<TaskRespo
let mut runtime_logs: Vec<LogInfo> = vec![];

for (call, params) in task.calls {
let vm_res = runtime_call::run(runtime_call::Config {
log::trace!("Calling {}", call);

let vm = runtime_call::run(runtime_call::Config {
virtual_machine: vm_proto.clone(),
function_to_call: call.as_str(),
parameter: params.into_iter().map(|x| x.0),
Expand All @@ -142,13 +144,13 @@ pub async fn run_task(task: TaskCall, js: crate::JsCallback) -> Result<TaskRespo
calculate_trie_changes: false,
});

log::trace!("Calling {}", call);

if let Err((start_err, _)) = vm_res {
return Ok(TaskResponse::Error(start_err.to_string()));
}

let mut vm = vm_res.unwrap();
let mut vm = match vm {
Ok(vm) => vm,
// ignore host_vm_proto since it doesn't provide any info
Err((start_err, _host_vm_proto)) => {
return Ok(TaskResponse::Error(start_err.to_string()));
}
};

let res = loop {
vm = match vm {
Expand Down

0 comments on commit 4bb0d71

Please sign in to comment.