Skip to content

Commit

Permalink
feat(wrb): getQueryResultCborbytes
Browse files Browse the repository at this point in the history
  • Loading branch information
guidiaz committed Mar 21, 2024
1 parent e7121c9 commit 4468d28
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
10 changes: 10 additions & 0 deletions contracts/core/defaults/WitnetOracleTrustableBase.sol
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,16 @@ abstract contract WitnetOracleTrustableBase
return WitnetOracleDataLib.seekQueryResponseStatus(_witnetQueryId);
}

/// @notice Retrieves the CBOR-encoded buffer containing the Witnet-provided result to the given query.
/// @param _witnetQueryId The unique query identifier.
function getQueryResultCborBytes(uint256 _witnetQueryId)
external view
virtual override
returns (bytes memory)
{
return WitnetOracleDataLib.seekQueryResponse(_witnetQueryId).resultCborBytes;
}

/// @notice Gets error code identifying some possible failure on the resolution of the given query.
/// @param _witnetQueryId The unique query identifier.
function getQueryResultError(uint256 _witnetQueryId)
Expand Down
4 changes: 4 additions & 0 deletions contracts/interfaces/IWitnetOracle.sol
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ interface IWitnetOracle {
/// @param queryId The unique query identifier.
function getQueryResponseStatus(uint256 queryId) external view returns (WitnetV2.ResponseStatus);

/// @notice Retrieves the CBOR-encoded buffer containing the Witnet-provided result to the given query.
/// @param queryId The unique query identifier.
function getQueryResultCborBytes(uint256 queryId) external view returns (bytes memory);

/// @notice Gets error code identifying some possible failure on the resolution of the given query.
/// @param queryId The unique query identifier.
function getQueryResultError(uint256 queryId) external view returns (Witnet.ResultError memory);
Expand Down

0 comments on commit 4468d28

Please sign in to comment.