Skip to content

Commit dfff63a

Browse files
committed
fix #888: Allow canonical case-insensitive ledger-object names in type filter
1 parent 1464e9e commit dfff63a

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

tests/integration/reqs/test_account_objects.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,24 @@ async def test_basic_functionality(self, client):
1313
)
1414
)
1515
self.assertTrue(response.is_successful())
16+
17+
@test_async_and_sync(globals())
18+
async def test_type_filter(self, client):
19+
response = await client.request(
20+
AccountObjects(
21+
account=WALLET.address,
22+
type="Escrow",
23+
)
24+
)
25+
self.assertTrue(response.is_successful())
26+
self.assertIsNotNone(response.result["account_objects"])
27+
28+
# test case-insensitive type filter
29+
response = await client.request(
30+
AccountObjects(
31+
account=WALLET.address,
32+
type="mPtOkeNisSuance",
33+
)
34+
)
35+
self.assertTrue(response.is_successful())
36+
self.assertIsNotNone(response.result["account_objects"])

xrpl/models/requests/account_objects.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
from dataclasses import dataclass, field
1111
from enum import Enum
12-
from typing import Any, Optional
12+
from typing import Any, Optional, Union
1313

1414
from xrpl.models.requests.request import LookupByLedgerRequest, Request, RequestMethod
1515
from xrpl.models.required import REQUIRED
@@ -65,7 +65,7 @@ class AccountObjects(Request, LookupByLedgerRequest):
6565
"""
6666

6767
method: RequestMethod = field(default=RequestMethod.ACCOUNT_OBJECTS, init=False)
68-
type: Optional[AccountObjectType] = None
68+
type: Optional[Union[AccountObjectType, str]] = None
6969
deletion_blockers_only: bool = False
7070
limit: Optional[int] = None
7171
# marker data shape is actually undefined in the spec, up to the

0 commit comments

Comments
 (0)