Skip to content

Commit

Permalink
Fix invalid account address (#611) (#625)
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

Co-authored-by: Jackson Mills <[email protected]>
  • Loading branch information
pdp2121 and JST5000 authored Jul 25, 2023
1 parent 1d51463 commit 1f400e7
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 = "rG1QQv2nh2gr7RCZ1P8YYcBUcCCN633jCn"
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.classic_address, None, True)
Expand Down

0 comments on commit 1f400e7

Please sign in to comment.