Skip to content

Commit

Permalink
chore: remove recoverer funding limitation (#288)
Browse files Browse the repository at this point in the history
* chore: remove limitation

* Remove InvalidRecoverer error and associated test case from IKintoWalletFactory interface and unit tests.

---------

Co-authored-by: Igor Yalovoy <[email protected]>
  • Loading branch information
VSBDev and ylv-io authored Oct 9, 2024
1 parent 588dcda commit 9089d2e
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 9 deletions.
1 change: 0 additions & 1 deletion src/interfaces/IKintoWalletFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ interface IKintoWalletFactory {
error KYCRequired();
error KYCMustNotExist();
error InvalidWallet(address);
error InvalidRecoverer(address);
error OnlyRecoverer(address, address);
error InvalidWalletOrFunder(address);
error InvalidSender(address);
Expand Down
1 change: 0 additions & 1 deletion src/wallet/KintoWalletFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,6 @@ contract KintoWalletFactory is Initializable, UUPSUpgradeable, OwnableUpgradeabl
* @param recoverer The recoverer address
*/
function sendMoneyToRecoverer(address wallet, address recoverer) external payable override {
if (recoverer.balance > 0) revert InvalidRecoverer(recoverer);
if (walletTs[wallet] == 0) revert InvalidWallet(wallet);
if (recoverer != IKintoWallet(wallet).recoverer()) {
revert OnlyRecoverer(recoverer, IKintoWallet(wallet).recoverer());
Expand Down
7 changes: 0 additions & 7 deletions test/unit/KintoWalletFactory.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -596,13 +596,6 @@ contract KintoWalletFactoryTest is SharedSetup {
assertEq(_recoverer.balance, amount);
}

function testSendMoneyToRecoverer_RevertWhenInvalidRecoverer() public {
vm.deal(_recoverer, 1);
vm.prank(_owner);
vm.expectRevert(abi.encodeWithSelector(IKintoWalletFactory.InvalidRecoverer.selector, address(_recoverer)));
_walletFactory.sendMoneyToRecoverer(address(_kintoWallet), _recoverer);
}

function testSendMoneyToRecoverer_RevertWhenInvalidWallet() public {
vm.expectRevert(abi.encodeWithSelector(IKintoWalletFactory.InvalidWallet.selector, address(this)));
_walletFactory.sendMoneyToRecoverer(address(this), _recoverer);
Expand Down

0 comments on commit 9089d2e

Please sign in to comment.