Skip to content

Commit

Permalink
Add cairo 0.6.2 (#54)
Browse files Browse the repository at this point in the history
  • Loading branch information
Solpatium authored Dec 15, 2021
1 parent 668baac commit 7989721
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 33 deletions.
3 changes: 2 additions & 1 deletion docs/client.rst
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ The possible statuses are:
- **RECEIVED**: The transaction was received by the operator.
- **PENDING**: The transaction passed the validation and is waiting to be sent on-chain.
- **REJECTED**: The transaction failed validation and thus was skipped.
- **ACCEPTED_ONCHAIN**: The transaction was accepted on-chain.
- **ACCEPTED_ON_L1**: The transaction was accepted on layer 1.
- **ACCEPTED_ON_L2**: The transaction was accepted on layer 2.

.. automethod:: Client.get_transaction
.. automethod:: Client.get_transaction_sync
Expand Down
61 changes: 34 additions & 27 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ documentation = "https://starknetpy.rtfd.io/"

[tool.poetry.dependencies]
python = "^3.7.12"
cairo-lang = "^0.6.0"
cairo-lang = "0.6.2"
asgiref = "^3.4.1"
sphinx = {version = "^4.3.1", optional = true}

Expand All @@ -27,7 +27,7 @@ pytest = "^6.2.5"
black = "^21.11b0"
poethepoet = "^0.11.0"
coverage = "^6.1.2"
starknet-devnet = "^0.1.9"
starknet-devnet = { git = "https://github.com/Shard-Labs/starknet-devnet.git", branch = "update-v0.6.2" }
pytest-asyncio = "^0.16.0"
sphinx-rtd-theme = "^1.0.0"
pylint = "^2.12.2"
Expand Down
5 changes: 4 additions & 1 deletion starknet/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,8 @@ class TxStatus(Enum):
NOT_RECEIVED = "NOT_RECEIVED"
REJECTED = "REJECTED"
PENDING = "PENDING"
ACCEPTED_ONCHAIN = "ACCEPTED_ONCHAIN"
ACCEPTED_ON_L1 = "ACCEPTED_ON_L1"
ACCEPTED_ON_L2 = "ACCEPTED_ON_L2"


ACCEPTED_STATUSES = (TxStatus.ACCEPTED_ON_L1, TxStatus.ACCEPTED_ON_L2)
4 changes: 2 additions & 2 deletions starknet/net/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from starkware.starknet.services.api.gateway.gateway_client import GatewayClient
from services.external_api.base_client import RetryConfig, BadRequest as BadRequestError

from starknet.constants import TxStatus
from starknet.constants import TxStatus, ACCEPTED_STATUSES
from starknet.utils.sync import add_sync_methods
from starknet.utils.types import net_address_from_net, InvokeFunction, Transaction

Expand Down Expand Up @@ -186,7 +186,7 @@ async def wait_for_tx(
result = await self.get_transaction(tx_hash=tx_hash)
status = TxStatus[result["status"]]

if status in (TxStatus.ACCEPTED_ONCHAIN, TxStatus.ACCEPTED_ON_L1):
if status in ACCEPTED_STATUSES:
return result["block_number"], status
if status == TxStatus.PENDING:
if not wait_for_accept and "block_number" in result:
Expand Down

0 comments on commit 7989721

Please sign in to comment.