diff --git a/packages/contracts/test/EmailAccountRecovery.t.sol b/packages/contracts/test/EmailAccountRecovery.t.sol index a1d40f58..8029ea62 100644 --- a/packages/contracts/test/EmailAccountRecovery.t.sol +++ b/packages/contracts/test/EmailAccountRecovery.t.sol @@ -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);