-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: update events; add test for events
- Loading branch information
Showing
10 changed files
with
230 additions
and
207 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
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 |
---|---|---|
|
@@ -6,9 +6,14 @@ import "./helpers/EmailWalletCoreTestHelper.sol"; | |
contract RelayerTest is EmailWalletCoreTestHelper { | ||
function test_RegisterRelayer() public { | ||
bytes32 randHash = keccak256(abi.encodePacked(uint(1001))); | ||
string memory emailAddr = "[email protected]"; | ||
string memory hostname = "relayer.xyz"; | ||
|
||
vm.startPrank(relayer); | ||
core.registerRelayer(randHash, "[email protected]", "relayer.xyz"); | ||
vm.expectEmit(); | ||
emit RelayerRegistered(relayer, randHash, emailAddr, hostname); | ||
|
||
core.registerRelayer(randHash, emailAddr, hostname); | ||
vm.stopPrank(); | ||
|
||
(bytes32 deployedRandHash, , ) = core.relayers(relayer); | ||
|
@@ -59,13 +64,18 @@ contract RelayerTest is EmailWalletCoreTestHelper { | |
// Update relayer hostname | ||
function test_UpdateRelayerHostname() public { | ||
bytes32 randHash = keccak256(abi.encodePacked(uint(1001))); | ||
string memory newHostname = "newdomain.xyz"; | ||
|
||
vm.startPrank(relayer); | ||
core.registerRelayer(randHash, "[email protected]", "relayer.xyz"); | ||
core.updateRelayerConfig("newdomain.xyz"); | ||
|
||
vm.expectEmit(); | ||
emit RelayerConfigUpdated(relayer, newHostname); | ||
core.updateRelayerConfig(newHostname); | ||
vm.stopPrank(); | ||
|
||
(, , string memory hostname) = core.relayers(relayer); | ||
assertTrue(Strings.equal(hostname, "newdomain.xyz")); | ||
|
||
assertTrue(Strings.equal(hostname, newHostname)); | ||
} | ||
} |
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
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
Oops, something went wrong.