-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d9ce766
commit d54b4b4
Showing
3 changed files
with
52 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.23; | ||
|
||
import {UpgradeableL2ResolverBase} from "./UpgradeableL2ResolverBase.t.sol"; | ||
import {ResolverBase} from "src/L2/resolver/ResolverBase.sol"; | ||
import {PubkeyResolver} from "src/L2/resolver/PubkeyResolver.sol"; | ||
|
||
contract SetPubkey is UpgradeableL2ResolverBase { | ||
bytes32 x = 0x65a2fa44daad46eab0278703edb6c4dcf5e30b8a9aec09fdc71a56f52aa392e4; | ||
bytes32 y = 0x4a7a9e4604aa36898209997288e902ac544a555e4b5e0a9efef2b59233f3f437; | ||
|
||
function test_reverts_forUnauthorizedUser() public { | ||
vm.expectRevert(abi.encodeWithSelector(ResolverBase.NotAuthorized.selector, node, notUser)); | ||
vm.prank(notUser); | ||
resolver.setPubkey(node, x, y); | ||
} | ||
|
||
function test_setsThePubkey() public { | ||
vm.prank(user); | ||
resolver.setPubkey(node, x, y); | ||
(bytes32 retX, bytes32 retY) = resolver.pubkey(node); | ||
assertEq(retX, x); | ||
assertEq(retY, y); | ||
} | ||
} |