Skip to content

Commit

Permalink
Merge d8a54b0 into 7e9ba31
Browse files Browse the repository at this point in the history
  • Loading branch information
falvaradorodriguez committed May 29, 2024
2 parents 7e9ba31 + d8a54b0 commit 3edda46
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion gnosis/safe/safe.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def __new__(
"""
assert fast_is_checksum_address(address), "%s is not a valid address" % address
if cls is not Safe:
return super().__new__(cls, address, ethereum_client, *args, **kwargs)
return super().__new__(cls, *args, **kwargs)

versions: Dict[str, Safe] = {
"0.0.1": SafeV001,
Expand Down
16 changes: 16 additions & 0 deletions gnosis/safe/tests/test_safe.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,22 @@ def test_domain_separator(self):
not_a_safe = Account.create().address
self.assertIsNone(Safe(not_a_safe, self.ethereum_client).domain_separator)

def test_inherit_safe(self):
address = Account.create().address
safe = SafeV141(address, self.ethereum_client)
self.assertEqual(safe.address, address)
self.assertEqual(safe.get_version(), "1.4.1")
self.assertEqual(safe.chain_id, 1337)

class CustomSafeV141(SafeV141):
def get_version(self):
return "1.4.1-custom"

inherited_safe = CustomSafeV141(address, self.ethereum_client)
self.assertEqual(inherited_safe.address, address)
self.assertEqual(inherited_safe.get_version(), "1.4.1-custom")
self.assertEqual(inherited_safe.chain_id, 1337)

def test_check_funds_for_tx_gas(self):
safe = self.deploy_test_safe()
safe_tx_gas = 2
Expand Down

0 comments on commit 3edda46

Please sign in to comment.