Skip to content

Commit 5c422a9

Browse files
committed
Merge branch 'master' into beta
2 parents 9632b79 + fcc27b2 commit 5c422a9

File tree

4 files changed

+5
-154
lines changed

4 files changed

+5
-154
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
- Support for cross-chain bridge proposal
1111
- Support for Automated Market Maker (AMM) transactions and requests as defined in XLS-30.
1212

13+
### Fixed:
14+
- Refactored `does_account_exist` to avoid deprecated methods and use `ledger_index` parameter
15+
1316
## [1.8.0] - 2023-04-10
1417
### Added:
1518
- Created function alias to `safe_sign_transaction` called `sign` - safe originally used to indicate local offline signing (keys aren't exposed)

tests/integration/sugar/test_account.py

Lines changed: 1 addition & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,7 @@
66
test_async_and_sync,
77
)
88
from tests.integration.reusable_values import DESTINATION, WALLET
9-
from xrpl.asyncio.account import (
10-
does_account_exist,
11-
get_account_info,
12-
get_account_transactions,
13-
get_balance,
14-
get_latest_transaction,
15-
)
9+
from xrpl.asyncio.account import does_account_exist, get_balance, get_latest_transaction
1610
from xrpl.core.addresscodec import classic_address_to_xaddress
1711
from xrpl.models.transactions import Payment
1812
from xrpl.wallet import Wallet
@@ -44,39 +38,6 @@ async def test_get_balance(self, client):
4438
int(FUNDING_AMOUNT),
4539
)
4640

47-
@test_async_and_sync(globals(), ["xrpl.account.get_account_transactions"])
48-
async def test_get_account_transactions(self, client):
49-
transactions = await get_account_transactions(
50-
NEW_WALLET.classic_address, client
51-
)
52-
self.assertEqual(len(transactions), 1)
53-
self.assertEqual(transactions[0]["tx"]["TransactionType"], "Payment")
54-
self.assertEqual(transactions[0]["tx"]["Amount"], FUNDING_AMOUNT)
55-
56-
@test_async_and_sync(globals(), ["xrpl.account.get_account_transactions"])
57-
async def test_get_account_transactions_empty(self, client):
58-
transactions = await get_account_transactions(
59-
EMPTY_WALLET.classic_address, client
60-
)
61-
self.assertEqual(len(transactions), 0)
62-
63-
@test_async_and_sync(globals(), ["xrpl.account.get_account_transactions"])
64-
async def test_payment_transactions(self, client):
65-
transactions = await get_account_transactions(
66-
NEW_WALLET.classic_address, client
67-
)
68-
self.assertEqual(len(transactions), 1)
69-
self.assertEqual(transactions[0]["tx"]["TransactionType"], "Payment")
70-
self.assertEqual(transactions[0]["tx"]["Amount"], FUNDING_AMOUNT)
71-
72-
@test_async_and_sync(globals(), ["xrpl.account.get_account_transactions"])
73-
async def test_payment_transactions_xaddress(self, client):
74-
xaddress = classic_address_to_xaddress(NEW_WALLET.classic_address, None, True)
75-
transactions = await get_account_transactions(xaddress, client)
76-
self.assertEqual(len(transactions), 1)
77-
self.assertEqual(transactions[0]["tx"]["TransactionType"], "Payment")
78-
self.assertEqual(transactions[0]["tx"]["Amount"], FUNDING_AMOUNT)
79-
8041
@test_async_and_sync(globals(), ["xrpl.account.get_latest_transaction"])
8142
async def test_get_latest_transaction(self, client):
8243
# NOTE: this test may take a long time to run
@@ -95,12 +56,3 @@ async def test_get_latest_transaction(self, client):
9556
self.assertEqual(transaction["TransactionType"], "Payment")
9657
self.assertEqual(transaction["Amount"], amount)
9758
self.assertEqual(transaction["Account"], WALLET.classic_address)
98-
99-
@test_async_and_sync(globals(), ["xrpl.account.get_account_info"])
100-
async def test_get_account_info(self, client):
101-
response = await get_account_info(WALLET.classic_address, client)
102-
self.assertTrue(response.is_successful())
103-
self.assertEqual(
104-
response.result["account_data"]["Account"],
105-
WALLET.classic_address,
106-
)

tests/integration/sugar/test_transaction.py

Lines changed: 0 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
XRPLReliableSubmissionException,
1414
autofill,
1515
autofill_and_sign,
16-
get_transaction_from_hash,
1716
send_reliable_submission,
1817
sign,
1918
)
@@ -48,109 +47,6 @@
4847

4948

5049
class TestTransaction(IntegrationTestCase):
51-
@test_async_and_sync(
52-
globals(),
53-
[
54-
"xrpl.transaction.autofill_and_sign",
55-
"xrpl.transaction.send_reliable_submission",
56-
"xrpl.transaction.get_transaction_from_hash",
57-
],
58-
)
59-
async def test_get_transaction_from_hash(self, client):
60-
# GIVEN a new transaction (payment)
61-
payment_transaction = Payment(
62-
account=WALLET.classic_address,
63-
amount="100",
64-
destination=DESTINATION,
65-
sequence=WALLET.sequence,
66-
)
67-
68-
# WHEN we sign locally, autofill, and submit the transaction
69-
response = await sign_and_reliable_submission_async(payment_transaction, WALLET)
70-
71-
# THEN we expect to retrieve this transaction from its hash
72-
payment = await get_transaction_from_hash(
73-
response.result["tx_json"]["hash"], client
74-
)
75-
76-
# AND we expect the result Account to be the same as the original payment Acct
77-
self.assertEqual(payment.result["Account"], ACCOUNT)
78-
# AND we expect the response to be successful (200)
79-
self.assertTrue(payment.is_successful())
80-
81-
WALLET.sequence += 1
82-
83-
@test_async_and_sync(
84-
globals(),
85-
[
86-
"xrpl.transaction.autofill_and_sign",
87-
"xrpl.transaction.send_reliable_submission",
88-
"xrpl.transaction.get_transaction_from_hash",
89-
],
90-
)
91-
async def test_get_transaction_from_hash_with_binary(self, client):
92-
# GIVEN a new transaction (payment)
93-
payment_transaction = Payment(
94-
account=WALLET.classic_address,
95-
amount="100",
96-
destination=DESTINATION,
97-
sequence=WALLET.sequence,
98-
)
99-
100-
# WHEN we sign locally, autofill, and submit the transaction
101-
response = await sign_and_reliable_submission_async(payment_transaction, WALLET)
102-
payment_hash = response.result["tx_json"]["hash"]
103-
104-
# THEN we expect to retrieve this transaction from its hash with the
105-
# binary parameter set to true
106-
payment = await get_transaction_from_hash(payment_hash, client, True)
107-
108-
# AND we expect the result hash to be the same as the original payment hash
109-
self.assertEqual(payment.result["hash"], payment_hash)
110-
# AND we expect the response to be successful (200)
111-
self.assertTrue(payment.is_successful())
112-
113-
WALLET.sequence += 1
114-
115-
@test_async_and_sync(
116-
globals(),
117-
[
118-
"xrpl.transaction.autofill_and_sign",
119-
"xrpl.transaction.send_reliable_submission",
120-
"xrpl.transaction.get_transaction_from_hash",
121-
],
122-
)
123-
async def test_get_transaction_from_hash_with_min_max_ledgers(self, client):
124-
# GIVEN a new transaction (payment)
125-
payment_transaction = Payment(
126-
account=WALLET.classic_address,
127-
amount="100",
128-
destination=DESTINATION,
129-
sequence=WALLET.sequence,
130-
)
131-
132-
# WHEN we sign locally, autofill, and submit the transaction
133-
response = await sign_and_reliable_submission_async(payment_transaction, WALLET)
134-
payment_hash = response.result["tx_json"]["hash"]
135-
payment_ledger_index = response.result["validated_ledger_index"]
136-
137-
# THEN we expect to retrieve this transaction from its hash with
138-
# min_ledger and max_ledger parameters
139-
payment = await get_transaction_from_hash(
140-
payment_hash,
141-
client,
142-
False,
143-
payment_ledger_index - 5,
144-
payment_ledger_index + 5,
145-
)
146-
147-
# AND we expect the result Account to be the same as the original payment Acct
148-
self.assertEqual(payment.result["Account"], ACCOUNT)
149-
# AND we expect the response to be successful (200)
150-
self.assertTrue(payment.is_successful())
151-
152-
WALLET.sequence += 1
153-
15450
@test_async_and_sync(
15551
globals(),
15652
)

xrpl/asyncio/account/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ async def does_account_exist(
3232
XRPLRequestFailureException: if the transaction fails.
3333
"""
3434
try:
35-
await get_account_info(address, client)
35+
await get_account_root(address, client, ledger_index=ledger_index)
3636
return True
3737
except XRPLRequestFailureException as e:
3838
if e.error == "actNotFound":

0 commit comments

Comments
 (0)