Skip to content

Commit a4f3d64

Browse files
committed
docs: improve documentation clarity in Royalty class and update error message in unit tests
1 parent b179f99 commit a4f3d64

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

src/story_protocol_python_sdk/resources/Royalty.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -158,15 +158,15 @@ def claim_all_revenue(
158158
tx_options: dict | None = None,
159159
) -> dict:
160160
"""
161-
Claims all revenue from the child IPs of an ancestor IP, then transfer all claimed tokens to the wallet if the wallet owns the IP or is the claimer. If claimed token is WIP, it will also be converted back to native tokens.
161+
Claims all revenue from the child IPs of an ancestor IP, then transfer all claimed tokens to the wallet if the wallet owns the IP or is the claimer. If claimed token is `WIP(Wrapped IP)`, it will also be converted back to native tokens.
162162
163163
Even if there are no child IPs, you must still populate `currency_tokens` with the token addresses you wish to claim. This is required for the claim operation to know which token balances to process.
164164
:param ancestor_ip_id str: The IP ID of the ancestor.
165165
:param claimer str: The address of the claimer.
166166
:param child_ip_ids list: List of child IP IDs.
167167
:param royalty_policies list: List of royalty policy addresses.
168168
:param currency_tokens list: List of currency token addresses.
169-
:param claim_options dict: [Optional] Options for auto_transfer_all_claimed_tokens_from_ip and auto_unwrap_ip_tokens. Default values are True.
169+
:param claim_options dict: [Optional] Options for `auto_transfer_all_claimed_tokens_from_ip` and `auto_unwrap_ip_tokens`. Default values are True.
170170
:param tx_options dict: [Optional] The transaction options.
171171
:return dict: A dictionary with transaction details and claimed tokens.
172172
"""
@@ -359,13 +359,7 @@ def _parse_tx_revenue_token_claimed_event(self, tx_receipt: dict) -> list:
359359
)[
360360
"args"
361361
]
362-
claimed_tokens.append(
363-
{
364-
"claimer": event_result["claimer"],
365-
"token": event_result["token"],
366-
"amount": event_result["amount"],
367-
}
368-
)
362+
claimed_tokens.append(event_result)
369363

370364
return claimed_tokens
371365

tests/unit/resources/test_royalty.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,6 @@ def test_claim_all_revenue_success_with_default_claim_options_and_is_claimer_ip_
278278
assert len(response["claimed_tokens"]) == 1
279279
assert response["claimed_tokens"][0]["amount"] == 120
280280

281-
# Need to change it
282281
def test_claim_all_revenue_with_default_claim_options_and_claimer_is_ip_and_owns_claimer_and_token_is_not_wip(
283282
self,
284283
royalty_client: Royalty,
@@ -355,7 +354,8 @@ def test_claim_all_revenue_with_default_claim_options_and_claimer_is_ip_and_own_
355354
],
356355
):
357356
with pytest.raises(
358-
ValueError, match="Multiple WIP tokens found in the claimed tokens."
357+
ValueError,
358+
match="Failed to claim all revenue: Multiple WIP tokens found in the claimed tokens.",
359359
):
360360
royalty_client.claim_all_revenue(
361361
ancestor_ip_id="0xA34611b0E11Bba2b11c69864f7D36aC83D862A9c",

0 commit comments

Comments
 (0)