From c2d2b9d55eb8e639cd300dfcce1afb214af22e6e Mon Sep 17 00:00:00 2001 From: SilkovAlexander Date: Tue, 11 May 2021 18:17:09 +0300 Subject: [PATCH] Fixed after comments --- src/call.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/call.rs b/src/call.rs index e25fd28b..039e8dde 100644 --- a/src/call.rs +++ b/src/call.rs @@ -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; } }