From 40ca24128d8d232cbe8b9fd96c00aa3bc50a6009 Mon Sep 17 00:00:00 2001 From: Ganesh Vanahalli Date: Thu, 28 Mar 2024 17:59:50 -0400 Subject: [PATCH] minor fix --- arbitrator/prover/src/lib.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/arbitrator/prover/src/lib.rs b/arbitrator/prover/src/lib.rs index 528d512278..ffd91696d3 100644 --- a/arbitrator/prover/src/lib.rs +++ b/arbitrator/prover/src/lib.rs @@ -316,7 +316,7 @@ macro_rules! handle_preimage_resolution { $hash, err, ), } - data + Some(data) }}; } @@ -332,11 +332,13 @@ pub unsafe extern "C" fn arbitrator_set_preimage_resolver( if cache.contains(&hash) { return cache.get(&hash).cloned(); } - let data = handle_preimage_resolution!(context, ty, hash, resolver); - cache.put(hash, data.clone()); - return Some(data); + if let Some(data) = handle_preimage_resolution!(context, ty, hash, resolver) { + cache.put(hash, data.clone()); + return Some(data); + } + return None; } - Some(handle_preimage_resolution!(context, ty, hash, resolver)) + handle_preimage_resolution!(context, ty, hash, resolver) }, ) as PreimageResolver); }