From 08671215fb9e6d3bfd03d86bad0a078e71cf4b04 Mon Sep 17 00:00:00 2001 From: Gas One Cent <86567384+gas1cent@users.noreply.github.com> Date: Tue, 7 Nov 2023 22:12:42 +0400 Subject: [PATCH] feat: add `getId` helpers --- solidity/test/utils/Helpers.sol | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/solidity/test/utils/Helpers.sol b/solidity/test/utils/Helpers.sol index 5d7691cf..af32e439 100644 --- a/solidity/test/utils/Helpers.sol +++ b/solidity/test/utils/Helpers.sol @@ -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)); + } }