Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions supra_sdk/clients/rest/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -535,8 +535,8 @@ async def account_history(
`account_coin_transactions` does not.

Needs a node from `supra_node_v12.0.0`. A node before v12 (Testnet and Mainnet until they run v12) answers
HTTP 404 with an empty body, raised as `supra_sdk.clients.api_client.ApiError` with `status_code` 404 and an
empty `message`.
HTTP 404 with an empty body, raised as `supra_sdk.clients.api_client.ApiNotFoundError` (a subclass of
`ApiError`) with `status_code` 404 and the message `Not Found`, the HTTP reason phrase.

Automated transactions and automation registry records are not listed; use
`account_automated_transactions` for those. While the node sends the `x-supra-history-indexed-from` response
Expand Down
9 changes: 4 additions & 5 deletions tests/unit/test_paging.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
import httpx

from supra_sdk.account_address import AccountAddress
from supra_sdk.clients import ApiClient
from supra_sdk.clients.api_client import ApiError
from supra_sdk.clients import ApiClient, ApiNotFoundError
from supra_sdk.clients.rest.paging import next_cursor
from supra_sdk.clients.rest.rest_types import (
AccountHistoryCategory,
Expand Down Expand Up @@ -680,12 +679,12 @@ async def test_only_a_missing_header_ends_a_page(self):
self.response = page([], "")
self.assertEqual(await client.account_history(ADDRESS), ([], None))

async def test_a_node_without_the_route_raises_api_error(self):
async def test_a_node_without_the_route_raises_not_found_error(self):
self.node = await FakeNode.create(lambda _: httpx.Response(404))
with self.assertRaises(ApiError) as raised:
with self.assertRaises(ApiNotFoundError) as raised:
await self.node.client.account_history(ADDRESS)
self.assertEqual(raised.exception.status_code, 404)
self.assertEqual(raised.exception.message, "")
self.assertEqual(raised.exception.message, "Not Found")

async def test_iterator_pages_past_an_empty_page_and_the_zero_cursor(self):
# The node filters by category while it scans: a page can be empty and carry a cursor, and "0" is the
Expand Down
Loading