From 7e94f9e922ae47e5ab5d4f85e0929a2c1bb259b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Federico=20Mart=C3=ADn=20Alconada=20Verzini?= Date: Sat, 27 Jan 2024 08:02:49 +0100 Subject: [PATCH] chore: increase coverage --- test/KintoWalletFactory.t.sol | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/test/KintoWalletFactory.t.sol b/test/KintoWalletFactory.t.sol index 3084c9b02..a6ca705e8 100644 --- a/test/KintoWalletFactory.t.sol +++ b/test/KintoWalletFactory.t.sol @@ -64,6 +64,28 @@ contract KintoWalletFactoryTest is SharedSetup { assertEq(address(_kintoWallet), address(_kintoWalletAfter)); } + function testCreateAccount_RevertWhen_ZeroAddress() public { + vm.prank(address(_owner)); + vm.expectRevert("invalid addresses"); + _kintoWallet = _walletFactory.createAccount(address(0), _owner, 0); + + vm.prank(address(_owner)); + vm.expectRevert("invalid addresses"); + _kintoWallet = _walletFactory.createAccount(_owner, address(0), 0); + } + + function testCreateAccount_RevertWhen_OwnerNotKYCd() public { + vm.prank(address(_user2)); + vm.expectRevert("KYC required"); + _kintoWallet = _walletFactory.createAccount(_user2, _owner, 0); + } + + function testCreateAccount_RevertWhen_OwnerAndSenderMismatch() public { + vm.prank(address(_owner)); + vm.expectRevert("KYC required"); + _kintoWallet = _walletFactory.createAccount(_user2, _owner, 0); + } + /* ============ Upgrade tests ============ */ function testUpgradeTo() public {