Skip to content

Commit

Permalink
Explain result_out type for query_external type
Browse files Browse the repository at this point in the history
  • Loading branch information
webmaster128 committed Nov 30, 2023
1 parent ff00e27 commit 5d06606
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions libwasmvm/src/querier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pub struct QuerierVtable {
gas_limit: u64,
gas_used: *mut u64,
request: U8SliceView,
result_out: *mut UnmanagedVector,
result_out: *mut UnmanagedVector, // A JSON encoded SystemResult<ContractResult<Binary>>
err_msg_out: *mut UnmanagedVector,
) -> i32,
>,
Expand Down Expand Up @@ -81,12 +81,12 @@ impl Querier for GoQuerier {
}

let bin_result: Vec<u8> = output.unwrap_or_default();
let result = serde_json::from_slice(&bin_result).or_else(|e| {
Ok(SystemResult::Err(SystemError::InvalidResponse {
let sys_result: SystemResult<_> = serde_json::from_slice(&bin_result).unwrap_or_else(|e| {
SystemResult::Err(SystemError::InvalidResponse {
error: format!("Parsing Go response: {e}"),
response: bin_result.into(),
}))
})
});
(result, gas_info)
(Ok(sys_result), gas_info)
}
}

0 comments on commit 5d06606

Please sign in to comment.