You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Re-route some errors as success (explanation below)
189
194
match dr_bytes {
190
-
Ok(dr_bytes) => Some(SetDrInfoBridge(
191
-
query_id,
192
-
DrInfoBridge{
193
-
dr_bytes,
194
-
dr_state:DrState::New,
195
-
dr_tx_hash:None,
196
-
dr_tx_creation_timestamp:None,
197
-
},
198
-
)),
195
+
Ok(dr_bytes) => Ok(dr_bytes),
199
196
Err(err) => {
200
197
log::error!("Fail to read dr bytes from contract: {}", err.to_string());
201
198
202
-
None
199
+
// In some versions of the bridge contracts (those based on
200
+
// `WitnetRequestBoardTrustableBase`), we may get a revert when trying to fetch the dr
201
+
// bytes for a deleted query.
202
+
// If that's the case, we can return a success here, with empty bytes, so that the
203
+
// request can locally marked as complete, and we can move on.
204
+
if err.to_string().contains("WitnetRequestBoardTrustableBase"){
205
+
log::error!("Wait! This is an instance of `WitnetRequestBoardTrustableBase`. Let's assume we got a revert because the dr bytes were deleted, and simply move on.");
206
+
207
+
Ok(Default::default())
208
+
// Otherwise, handle the error normally
209
+
}else{
210
+
Err(err)
211
+
}
203
212
}
204
-
}
213
+
// Wrap the dr bytes in a `SetDrInfoBridge` structure
0 commit comments