Skip to content

Commit

Permalink
Remove wait_for_accept parameter (#1276)
Browse files Browse the repository at this point in the history
* Remove `wait_for_accept` parameter

* Update migration guide
  • Loading branch information
ddoktorski committed Feb 5, 2024
1 parent a604664 commit e26efe2
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 18 deletions.
1 change: 1 addition & 0 deletions docs/migration_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ Changes in the :class:`~starknet_py.net.full_node_client.FullNodeClient`:
10. :class:`ResourcePrice` field ``price_in_strk`` has been renamed to ``price_in_fri`` and has now become required.
11. :class:`ResourceLimits` class has been renamed to :class:`ResourceBounds`.
12. :class:`~starknet_py.net.account.base_account.BaseAccount` and :class:`~starknet_py.net.account.account.Account` property ``supported_transaction_version`` has been removed.
13. ``wait_for_accept`` parameter in :meth:`Client.wait_for_tx` and :meth:`SentTransaction.wait_for_acceptance` has been removed.

0.19.0 Minor changes
--------------------
Expand Down
7 changes: 0 additions & 7 deletions starknet_py/contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import dataclasses
import json
import warnings
from abc import ABC, abstractmethod
from dataclasses import dataclass
from functools import cached_property
Expand Down Expand Up @@ -117,19 +116,13 @@ class SentTransaction:

async def wait_for_acceptance(
self: TypeSentTransaction,
wait_for_accept: Optional[bool] = None,
check_interval: float = 2,
retries: int = 500,
) -> TypeSentTransaction:
"""
Waits for transaction to be accepted on chain till ``ACCEPTED`` status.
Returns a new SentTransaction instance, **does not mutate original instance**.
"""
if wait_for_accept is not None:
warnings.warn(
"Parameter `wait_for_accept` has been deprecated - since Starknet 0.12.0, transactions in a PENDING"
" block have status ACCEPTED_ON_L2."
)

tx_receipt = await self._client.wait_for_tx(
self.hash,
Expand Down
11 changes: 0 additions & 11 deletions starknet_py/net/client.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from __future__ import annotations

import asyncio
import warnings
from abc import ABC, abstractmethod
from typing import List, Optional, Union

Expand Down Expand Up @@ -137,7 +136,6 @@ async def get_transaction_status(self, tx_hash: Hash) -> TransactionStatusRespon
async def wait_for_tx(
self,
tx_hash: Hash,
wait_for_accept: Optional[bool] = None, # pylint: disable=unused-argument
check_interval: float = 2,
retries: int = 500,
) -> TransactionReceipt:
Expand All @@ -146,10 +144,6 @@ async def wait_for_tx(
Awaits for transaction to get accepted or at least pending by polling its status.
:param tx_hash: Transaction's hash.
:param wait_for_accept:
.. deprecated:: 0.17.0
Parameter `wait_for_accept` has been deprecated - since Starknet 0.12.0, transactions in a PENDING
block have status ACCEPTED_ON_L2.
:param check_interval: Defines interval between checks.
:param retries: Defines how many times the transaction is checked until an error is thrown.
:return: Transaction receipt.
Expand All @@ -158,11 +152,6 @@ async def wait_for_tx(
raise ValueError("Argument check_interval has to be greater than 0.")
if retries <= 0:
raise ValueError("Argument retries has to be greater than 0.")
if wait_for_accept is not None:
warnings.warn(
"Parameter `wait_for_accept` has been deprecated - since Starknet 0.12.0, transactions in a PENDING"
" block have status ACCEPTED_ON_L2."
)

transaction_received = False
while True:
Expand Down

0 comments on commit e26efe2

Please sign in to comment.