Skip to content

Commit

Permalink
feat: Update ERC20Permit test for inheritance (#18)
Browse files Browse the repository at this point in the history
* feat: update ERC20Permit test for inheritance

* feat: add comment
  • Loading branch information
Lucas Manuel authored Mar 4, 2022
1 parent 9734658 commit 756c110
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions contracts/test/ERC20Permit.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { ERC20PermitUser } from "./accounts/ERC20User.sol";

import { MockERC20Permit } from "./mocks/MockERC20.sol";

import { Vm } from "./utils/Vm.sol";
import { Vm } from "./utils/Vm.sol";
import { InvariantTest } from "./utils/InvariantTest.sol";

import { ERC20Test, MockERC20 } from "./ERC20.t.sol";
Expand Down Expand Up @@ -41,9 +41,7 @@ contract ERC20PermitTest is DSTest {

uint256 constant WAD = 10 ** 18;

function setUp() external {
vm = Vm(address(bytes20(uint160(uint256(keccak256("hevm cheat code"))))));

function setUp() public virtual {
owner = vm.addr(skOwner);
spender = vm.addr(skSpender);

Expand All @@ -56,7 +54,8 @@ contract ERC20PermitTest is DSTest {
assertEq(token.PERMIT_TYPEHASH(), keccak256("Permit(address owner,address spender,uint256 amount,uint256 nonce,uint256 deadline)"));
}

function test_domainSeparator() external {
// NOTE: Virtual so inheriting tests can override with different DOMAIN_SEPARATORs because of different addresses
function test_domainSeparator() external virtual {
assertEq(token.DOMAIN_SEPARATOR(), 0x06c0ee43424d25534e5af6b6af862333b542f6583ff9948b8299442926099eec);
}

Expand Down

0 comments on commit 756c110

Please sign in to comment.