Skip to content

Commit

Permalink
fix(wrb): readResponseResult must return unsuccessful result if repon…
Browse files Browse the repository at this point in the history
…se cbor value is empty
  • Loading branch information
guidiaz committed Aug 13, 2024
1 parent b139dc7 commit 2e728ed
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion contracts/impls/core/customs/WitnetRequestBoardBypassV20.sol
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,21 @@ contract WitnetRequestBoardBypassV20
legacyFallback(_queryId)
returns (Witnet.Result memory)
{
return Witnet.resultFromCborBytes(__response(_queryId).cborBytes);
if (__response(_queryId).cborBytes.length > 0) {
return Witnet.resultFromCborBytes(__response(_queryId).cborBytes);
} else {
return Witnet.Result({
success: false,
value: WitnetCBOR.CBOR({
buffer: WitnetBuffer.Buffer(hex"", 0),
initialByte: 0,
majorType: 0,
additionalInformation: 0,
len: 0,
tag: 0
})
});
}
}

/// Retrieves the timestamp in which the result to the referred query was solved by the Witnet DON.
Expand Down

0 comments on commit 2e728ed

Please sign in to comment.