Skip to content

Commit

Permalink
feat: add getId helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
gas1cent committed Nov 7, 2023
1 parent 8e3f8fa commit 0867121
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 0867121

Please sign in to comment.