diff --git a/ape_safe/client/mock.py b/ape_safe/client/mock.py index a8b6862..28b859b 100644 --- a/ape_safe/client/mock.py +++ b/ape_safe/client/mock.py @@ -146,8 +146,6 @@ def delegator_for_delegate(self, delegate: AddressType) -> Optional[AddressType] return None def add_delegate(self, delegate: AddressType, label: str, delegator: AccountAPI): - delegate = self.conversion_manager.convert(delegate, AddressType) - if delegator.address not in self.safe_details.owners: raise SafeClientException(f"'{delegator}' not a valid owner.") @@ -158,8 +156,6 @@ def add_delegate(self, delegate: AddressType, label: str, delegator: AccountAPI) self.delegates[delegator.address] = [delegate] def remove_delegate(self, delegate: AddressType, delegator: AccountAPI): - delegate = self.conversion_manager.convert(delegate, AddressType) - if delegator.address not in self.safe_details.owners: raise SafeClientException(f"'{delegator.address}' not a valid owner.") diff --git a/tests/functional/test_delegates.py b/tests/functional/test_delegates.py index 9b1eeec..9270098 100644 --- a/tests/functional/test_delegates.py +++ b/tests/functional/test_delegates.py @@ -7,13 +7,13 @@ def test_manage_delegates(safe, delegate, OWNERS): owner = OWNERS[0] assert owner.address not in safe.client.get_delegates() - safe.client.add_delegate(delegate, "pepito", owner) + safe.client.add_delegate(delegate.address, "pepito", owner) assert delegate.address in safe.client.get_delegates()[owner.address] assert delegate.address in safe.all_delegates() # NOTE: Only in MockSafeClient assert safe.client.delegator_for_delegate(delegate.address) == owner.address - safe.client.remove_delegate(delegate, owner) + safe.client.remove_delegate(delegate.address, owner) assert owner.address not in safe.client.get_delegates() with pytest.raises(SafeClientException): @@ -32,7 +32,7 @@ def test_delegate_can_propose_safe_tx(safe, delegate, OWNERS): # Not a delegate or signer safe.propose_safe_tx(safe_tx, submitter=delegate) - safe.client.add_delegate(delegate, "pepito", owner) + safe.client.add_delegate(delegate.address, "pepito", owner) safe.propose_safe_tx(safe_tx, submitter=delegate) assert len(safe.get_api_confirmations(safe_tx)) == 0