Skip to content

Commit

Permalink
Add failing test for unauthorized setting of URI
Browse files Browse the repository at this point in the history
  • Loading branch information
Arachnid committed Sep 9, 2024
1 parent f285abb commit cd24132
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions contracts/test/RootRegistry.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,14 @@ contract TestRootRegistry is Test, ERC1155Holder {
actualUri = registry.uri(tokenId);
vm.assertEq(actualUri, uri);
}

function testFail_cannot_set_unauthorized_uri() public {
string memory uri = "https://example.com/";
uint256 tokenId = registry.mint("test2", address(registry), registry, 0, uri);
string memory actualUri = registry.uri(tokenId);
vm.assertEq(actualUri, uri);

uri = "https://ens.domains/";
registry.setUri(tokenId, uri);
}
}

0 comments on commit cd24132

Please sign in to comment.