Skip to content

Commit

Permalink
Registry coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
stevieraykatz committed Jun 14, 2024
1 parent 7461260 commit 496715b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
20 changes: 20 additions & 0 deletions test/Registry/RecordExists.t.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.23;

import "forge-std/Test.sol";
import {Registry} from "src/L2/Registry.sol";
import {ENS} from "ens-contracts/registry/ENS.sol";
import {ETH_NODE, BASE_ETH_NODE} from "src/util/Constants.sol";
import {NameEncoder} from "ens-contracts/utils/NameEncoder.sol";
import {RegistryBase} from "./RegistryBase.t.sol";

contract RecordExists is RegistryBase {
function test_correctlyConfirmsARecordExists() public view {
assertTrue(registry.recordExists(BASE_ETH_NODE));
}

function text_correctlyConfirmsARecordDoesNotExist(bytes32 node) public view {
vm.assume(node != BASE_ETH_NODE && node != ETH_NODE && node != bytes32(0));
assertFalse(registry.recordExists(node));
}
}
4 changes: 2 additions & 2 deletions test/Registry/RegistryBase.t.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.23;

import "forge-std/Test.sol";
import {Test} from "forge-std/Test.sol";
import {Registry} from "src/L2/Registry.sol";
import {ETH_NODE} from "src/util/Constants.sol";

Expand All @@ -28,7 +28,7 @@ contract RegistryBase is Test {
assertTrue(registry.owner(bytes32(0)) == rootOwner);
}

function _ownershipSetup() public virtual {
function _ownershipSetup() internal virtual {
// establish the base.eth namespace
bytes32 ethLabel = keccak256("eth");
bytes32 baseLabel = keccak256("base");
Expand Down

0 comments on commit 496715b

Please sign in to comment.