Skip to content

Commit

Permalink
Fixed after comments
Browse files Browse the repository at this point in the history
  • Loading branch information
SilkovAlexander committed May 11, 2021
1 parent 1662001 commit c2d2b9d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/call.rs
Original file line number Diff line number Diff line change
Expand Up @@ -387,14 +387,14 @@ pub async fn call_contract_with_result(
// but if it was simulated locally and local exit code is not zero,
// we ignore previous exit code because it means we shouldn't make a retry.
if !err.data["exit_code"].is_null() {
if err.data["exit_code"].as_i64().unwrap() != 0 {
if err.data["exit_code"].as_i64().unwrap_or(-1) != 0 {
retry = false;
}
}
// There is also another way how SDK can print local run results.
let local_error = err.data["local_error"]["data"]["exit_code"].clone();
if !local_error.is_null() {
if local_error.as_i64().unwrap() != 0 {
if local_error.as_i64().unwrap_or(-1) != 0 {
retry = false;
}
}
Expand Down

0 comments on commit c2d2b9d

Please sign in to comment.