Skip to content

Commit

Permalink
chore: implement pending IWitOracleLegacy methods
Browse files Browse the repository at this point in the history
  • Loading branch information
guidiaz committed Nov 4, 2024
1 parent e3d1824 commit 355db94
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
16 changes: 12 additions & 4 deletions contracts/core/base/WitOracleBaseTrustable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -170,16 +170,24 @@ abstract contract WitOracleBaseTrustable
return hex"";
}

function getQueryResponseStatus(uint256 queryId) virtual override external view returns (IWitOracleLegacy.QueryResponseStatus) {
// todo
function getQueryResponseStatus(uint256 queryId) virtual override public view returns (IWitOracleLegacy.QueryResponseStatus) {
return WitOracleDataLib.getQueryResponseStatus(
Witnet.QueryId.wrap(queryId)
);
}

function getQueryResultCborBytes(uint256 queryId) virtual override external view returns (bytes memory) {
// todo
return getQueryResponse(Witnet.QueryId.wrap(queryId)).resultCborBytes;
}

function getQueryResultError(uint256 queryId) virtual override external view returns (IWitOracleLegacy.ResultError memory) {
// todo
Witnet.DataResult memory _result = getQueryResult(
Witnet.QueryId.wrap(queryId)
);
return IWitOracleLegacy.ResultError({
code: uint8(_result.status),
reason: WitOracleResultStatusLib.toString(_result)
});
}

function postRequest(
Expand Down
10 changes: 5 additions & 5 deletions contracts/libs/Witnet.sol
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@ library Witnet {

/// Data struct containing the Witnet-provided result to a Data Request.
struct DataResult {
ResultStatus status;
RadonDataTypes dataType;
TransactionHash drTxHash;
ResultTimestamp timestamp;
WitnetCBOR.CBOR value;
ResultStatus status;
RadonDataTypes dataType;
TransactionHash drTxHash;
ResultTimestamp timestamp;
WitnetCBOR.CBOR value;
}

struct FastForward {
Expand Down

0 comments on commit 355db94

Please sign in to comment.