Skip to content

Commit

Permalink
Add new test cases to EmailAccountRecovery.t.sol.
Browse files Browse the repository at this point in the history
  • Loading branch information
wshino committed Apr 2, 2024
1 parent 156456c commit 8f6b1ef
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions packages/contracts/test/EmailAccountRecovery.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,21 @@ contract EmailAccountRecoveryTest is SimpleWallet, Test {
vm.stopPrank();
}

function testExpectRevertTransferOnlyOwner() public {
setUpForPublic();
vm.expectRevert(bytes("only owner"));
this.transfer(receiver, 1 ether);
}

function testExpectRevertTransferOnlyOwnerInsufficientBalance() public {
setUpForPublic();
vm.startPrank(deployer);
assertEq(receiver.balance, 0 ether);
vm.expectRevert(bytes("insufficient balance"));
this.transfer(receiver, 2 ether);
vm.stopPrank();
}

function testFailTransfer() public {
setUpForPublic();
vm.startPrank(receiver);
Expand Down

0 comments on commit 8f6b1ef

Please sign in to comment.