Skip to content

Commit

Permalink
docs: add natspec for helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
gas1cent committed Nov 22, 2023
1 parent 4fd09e6 commit 310297f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions solidity/test/utils/Helpers.sol
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,22 @@ contract Helpers is DSTestPlus {
_id = keccak256(abi.encode(_dispute));
}

/**
* @notice Creates a mock contract, labels it and erases the bytecode
*
* @param _label The label to use for the mock contract
* @return _contract The address of the mock contract
*/
function _mockContract(string memory _label) internal returns (address _contract) {
_contract = makeAddr(_label);
vm.etch(_contract, hex'69');
}

/**
* @notice Sets an expectation for an event to be emitted
*
* @param _contract The contract to expect the event on
*/
function _expectEmit(address _contract) internal {
vm.expectEmit(true, true, true, true, _contract);
}
Expand Down

0 comments on commit 310297f

Please sign in to comment.