Skip to content

Commit

Permalink
Fix invalid account address (#611)
Browse files Browse the repository at this point in the history
* Fix invalid account address

* Add invalid account test

* Remove magic address in favor of Wallet.create()

* Add classic_address
  • Loading branch information
JST5000 committed Jul 5, 2023
1 parent 1804674 commit 7d2ecad
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tests/integration/sugar/test_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
)
from tests.integration.reusable_values import DESTINATION, WALLET
from xrpl.asyncio.account import does_account_exist, get_balance, get_latest_transaction
from xrpl.asyncio.clients.exceptions import XRPLRequestFailureException
from xrpl.core.addresscodec import classic_address_to_xaddress
from xrpl.models.transactions import Payment
from xrpl.wallet import Wallet
Expand All @@ -23,9 +24,15 @@ async def test_does_account_exist_true(self, client):

@test_async_and_sync(globals(), ["xrpl.account.does_account_exist"])
async def test_does_account_exist_false(self, client):
address = "raovjX3BJ5Z3zfgcCdebqYbQBCZswsm9bz"
address = Wallet.create().classic_address
self.assertFalse(await does_account_exist(address, client))

@test_async_and_sync(globals(), ["xrpl.account.does_account_exist"])
async def test_does_account_exist_throws_for_invalid_account(self, client):
address = "a"
with self.assertRaises(XRPLRequestFailureException):
await does_account_exist(address, client)

@test_async_and_sync(globals(), ["xrpl.account.does_account_exist"])
async def test_does_account_exist_xaddress(self, client):
xaddress = classic_address_to_xaddress(WALLET.address, None, True)
Expand Down

0 comments on commit 7d2ecad

Please sign in to comment.