diff --git a/starknet-core/src/types/execution_result.rs b/starknet-core/src/types/execution_result.rs index 3479d554..43e8f652 100644 --- a/starknet-core/src/types/execution_result.rs +++ b/starknet-core/src/types/execution_result.rs @@ -68,13 +68,12 @@ impl<'de> Deserialize<'de> for ExecutionResult { match (raw.execution_status, raw.revert_reason) { (TransactionExecutionStatus::Succeeded, None) => Ok(Self::Succeeded), - (TransactionExecutionStatus::Reverted, Some(reason)) => Ok(Self::Reverted { reason }), + (TransactionExecutionStatus::Reverted, reason) => Ok(Self::Reverted { + reason: reason.unwrap_or_default(), + }), (TransactionExecutionStatus::Succeeded, Some(_)) => Err(serde::de::Error::custom( "field `revert_reason` must not exist when `execution_status` is `SUCCEEDED`", )), - (TransactionExecutionStatus::Reverted, None) => Err(serde::de::Error::custom( - "field `revert_reason` missing when `execution_status` is `REVERTED`", - )), } } }