Skip to content

Commit

Permalink
feat: switch from timestamp to block number
Browse files Browse the repository at this point in the history
  • Loading branch information
gas1cent committed Nov 17, 2023
1 parent bfc2706 commit 59a5e3e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions solidity/contracts/Oracle.sol
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ contract Oracle is IOracle {
_participants[_requestId] = abi.encodePacked(_participants[_requestId], _response.proposer);
IResponseModule(_request.responseModule).propose(_request, _response, msg.sender);
_responseIds[_requestId] = abi.encodePacked(_responseIds[_requestId], _responseId);
createdAt[_responseId] = uint128(block.timestamp);
createdAt[_responseId] = uint128(block.number);

emit ResponseProposed(_requestId, _response, _responseId, block.number);
}
Expand Down Expand Up @@ -164,7 +164,7 @@ contract Oracle is IOracle {
_participants[_requestId] = abi.encodePacked(_participants[_requestId], msg.sender);
disputeStatus[_disputeId] = DisputeStatus.Active;
disputeOf[_responseId] = _disputeId;
createdAt[_disputeId] = uint128(block.timestamp);
createdAt[_disputeId] = uint128(block.number);

IDisputeModule(_request.disputeModule).disputeResponse(_request, _response, _dispute);

Expand Down Expand Up @@ -345,7 +345,7 @@ contract Oracle is IOracle {
_finalizedResponses[_requestId] = _responseId;
}

finalizedAt[_requestId] = uint128(block.timestamp);
finalizedAt[_requestId] = uint128(block.number);

if (address(_request.finalityModule) != address(0)) {
IFinalityModule(_request.finalityModule).finalizeRequest(_request, _response, msg.sender);
Expand Down Expand Up @@ -376,7 +376,7 @@ contract Oracle is IOracle {
if (_requestNonce != _request.nonce || msg.sender != _request.requester) revert Oracle_InvalidRequestBody();

_requestId = _getId(_request);
createdAt[_requestId] = uint128(block.timestamp);
createdAt[_requestId] = uint128(block.number);
_requestIds[_requestNonce] = _requestId;

_allowedModules[_requestId] = abi.encodePacked(

Check failure on line 382 in solidity/contracts/Oracle.sol

View workflow job for this annotation

GitHub Actions / Run Linters (16.x)

Missing named parameters. Max unnamed parameters value is 4
Expand Down
8 changes: 4 additions & 4 deletions solidity/interfaces/IOracle.sol
Original file line number Diff line number Diff line change
Expand Up @@ -266,18 +266,18 @@ interface IOracle {
function disputeStatus(bytes32 _disputeId) external view returns (DisputeStatus _status);

/**
* @notice The creation timestamp of a request, response, or a dispute
* @notice The number of the block at which a request, response, or a dispute was created
*
* @param _id The request, response, or dispute id
* @return _createdAt The time of the creation
* @return _createdAt The block number
*/
function createdAt(bytes32 _id) external view returns (uint128 _createdAt);

/**
* @notice The finalization timestamp of a request
* @notice The number of the block at which a request was finalized
*
* @param _requestId The request id
* @return _finalizedAt The time of the finalization
* @return _finalizedAt The block number
*/
function finalizedAt(bytes32 _requestId) external view returns (uint128 _finalizedAt);

Expand Down

0 comments on commit 59a5e3e

Please sign in to comment.