From 1f400e7ebaa6ba8372fa3f0e377926ad1cbd0645 Mon Sep 17 00:00:00 2001 From: pdp2121 <71317875+pdp2121@users.noreply.github.com> Date: Tue, 25 Jul 2023 11:19:22 -0400 Subject: [PATCH] Fix invalid account address (#611) (#625) * Fix invalid account address * Add invalid account test * Remove magic address in favor of Wallet.create() * Add classic_address Co-authored-by: Jackson Mills --- tests/integration/sugar/test_account.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/integration/sugar/test_account.py b/tests/integration/sugar/test_account.py index bed129100..1293f13f1 100644 --- a/tests/integration/sugar/test_account.py +++ b/tests/integration/sugar/test_account.py @@ -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 @@ -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)