Skip to content

Commit

Permalink
feat: add helpers for computing ids
Browse files Browse the repository at this point in the history
  • Loading branch information
gas1cent committed Nov 6, 2023
1 parent bf795a1 commit 84614eb
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions solidity/test/utils/Helpers.sol
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,16 @@ contract Helpers is DSTestPlus {
_accountingExtension.deposit(_token, _depositAmount);
vm.stopPrank();
}

function _getId(IOracle.Response memory _response) internal pure returns (bytes32 _id) {
_id = keccak256(abi.encode(_response));
}

function _getId(IOracle.Request memory _request) internal pure returns (bytes32 _id) {
_id = keccak256(abi.encode(_request));
}

function _getId(IOracle.Dispute memory _dispute) internal pure returns (bytes32 _id) {
_id = keccak256(abi.encode(_dispute));
}
}

0 comments on commit 84614eb

Please sign in to comment.