Skip to content

Commit d56f105

Browse files
committed
Merge branch 'development'
2 parents c1c8978 + 67049e0 commit d56f105

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+1619
-12745
lines changed

.github/workflows/checks.yml

Lines changed: 25 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@ jobs:
3232
pip install poetry
3333
poetry config installer.modern-installation false
3434
35-
- name: Set up Python 3.9
35+
- name: Set up Python 3.12
3636
uses: actions/setup-python@v4
3737
with:
38-
python-version: "3.9"
38+
python-version: "3.12"
3939
cache: 'poetry'
4040

4141
- name: Install dependencies
4242
run: |
43-
poetry install --without py39-dev
43+
poetry install
4444
4545
- name: Check poetry.lock
4646
run: |
@@ -67,7 +67,7 @@ jobs:
6767
runs-on: ubuntu-latest
6868
strategy:
6969
matrix:
70-
python-version: [ "3.9" ]
70+
python-version: [ "3.12" ]
7171
steps:
7272

7373
# ====================== SETUP ====================== #
@@ -76,7 +76,7 @@ jobs:
7676

7777
- uses: actions/setup-python@v4
7878
with:
79-
python-version: "3.9"
79+
python-version: "3.12"
8080
cache: 'pip'
8181

8282
- name: Install poetry
@@ -85,10 +85,10 @@ jobs:
8585
pip install poetry
8686
poetry config installer.modern-installation false
8787
88-
- name: Install python 3.9 requirements
88+
- name: Install deprecated cairo compiler
8989
run: |
90-
poetry export -f requirements.txt --only=py39-dev --without-hashes --output requirements.txt
91-
pip install -r requirements.txt
90+
pip install --upgrade setuptools
91+
pip install cairo-lang==0.13.0
9292
9393
- name: Set up Python ${{ matrix.python-version }}
9494
uses: actions/setup-python@v4
@@ -98,7 +98,7 @@ jobs:
9898

9999
- name: Install dependencies
100100
run: |
101-
poetry install --without py39-dev
101+
poetry install
102102
103103
# ====================== CONTRACTS v0 ====================== #
104104

@@ -131,7 +131,7 @@ jobs:
131131
strategy:
132132
fail-fast: false
133133
matrix:
134-
python-version: [ "3.8", "3.9", "3.10", "3.11" ]
134+
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ]
135135
steps:
136136
- uses: actions/checkout@v3
137137
- uses: actions-rust-lang/setup-rust-toolchain@v1
@@ -145,7 +145,7 @@ jobs:
145145

146146
- uses: actions/setup-python@v4
147147
with:
148-
python-version: "3.9"
148+
python-version: "3.12"
149149
cache: 'pip'
150150

151151
# ====================== SETUP PYTHON ====================== #
@@ -156,11 +156,6 @@ jobs:
156156
pip install poetry
157157
poetry config installer.modern-installation false
158158
159-
- name: Install python 3.9 requirements
160-
run: |
161-
poetry export -f requirements.txt --only=py39-dev --without-hashes --output requirements.txt
162-
pip install -r requirements.txt
163-
164159
- name: Set up Python ${{ matrix.python-version }}
165160
uses: actions/setup-python@v4
166161
with:
@@ -169,7 +164,7 @@ jobs:
169164

170165
- name: Install dependencies
171166
run: |
172-
poetry install --without py39-dev
167+
poetry install
173168
174169
# ====================== SETUP DEVNET ====================== #
175170

@@ -227,7 +222,7 @@ jobs:
227222

228223
- uses: actions/setup-python@v4
229224
with:
230-
python-version: "3.9"
225+
python-version: "3.12"
231226
cache: 'pip'
232227

233228
# ====================== SETUP PYTHON ====================== #
@@ -238,20 +233,15 @@ jobs:
238233
pip install poetry
239234
poetry config installer.modern-installation false
240235
241-
- name: Install python 3.9 requirements
242-
run: |
243-
poetry export -f requirements.txt --only=py39-dev --without-hashes --output requirements.txt
244-
pip install -r requirements.txt
245-
246-
- name: Set up Python 3.9
236+
- name: Set up Python 3.12
247237
uses: actions/setup-python@v4
248238
with:
249-
python-version: "3.9"
239+
python-version: "3.12"
250240
cache: 'poetry'
251241

252242
- name: Install dependencies
253243
run: |
254-
poetry install --without py39-dev
244+
poetry install
255245
256246
# ====================== RUN TESTS ====================== #
257247

@@ -282,7 +272,7 @@ jobs:
282272
strategy:
283273
fail-fast: false
284274
matrix:
285-
python-version: [ "3.8", "3.9", "3.10", "3.11" ]
275+
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ]
286276
steps:
287277
- uses: actions/checkout@v3
288278
- uses: actions-rust-lang/setup-rust-toolchain@v1
@@ -296,7 +286,7 @@ jobs:
296286

297287
- uses: actions/setup-python@v4
298288
with:
299-
python-version: "3.9"
289+
python-version: "3.12"
300290
cache: 'pip'
301291

302292
# ====================== SETUP DEVNET ====================== #
@@ -312,11 +302,6 @@ jobs:
312302
pip install poetry
313303
poetry config installer.modern-installation false
314304
315-
- name: Install python 3.9 requirements
316-
run: |
317-
poetry export -f requirements.txt --only=py39-dev --without-hashes --output requirements.txt
318-
pip install -r requirements.txt
319-
320305
- name: Set up Python ${{ matrix.python-version }}
321306
uses: actions/setup-python@v4
322307
with:
@@ -325,7 +310,7 @@ jobs:
325310

326311
- name: Install dependencies
327312
run: |
328-
poetry install --without py39-dev
313+
poetry install
329314
330315
# ====================== RUN TESTS ====================== #
331316

@@ -356,7 +341,7 @@ jobs:
356341
strategy:
357342
fail-fast: false
358343
matrix:
359-
python-version: [ "3.8", "3.9", "3.10", "3.11" ]
344+
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ]
360345
steps:
361346
- uses: actions/checkout@v3
362347
- uses: actions-rust-lang/setup-rust-toolchain@v1
@@ -370,7 +355,7 @@ jobs:
370355

371356
- uses: actions/setup-python@v4
372357
with:
373-
python-version: "3.9"
358+
python-version: "3.12"
374359
cache: 'pip'
375360

376361
# ====================== SETUP PYTHON ====================== #
@@ -381,11 +366,6 @@ jobs:
381366
pip install poetry
382367
poetry config installer.modern-installation false
383368
384-
- name: Install python 3.9 requirements
385-
run: |
386-
poetry export -f requirements.txt --only=py39-dev --without-hashes --output requirements.txt
387-
pip install -r requirements.txt
388-
389369
- name: Set up Python ${{ matrix.python-version }}
390370
uses: actions/setup-python@v4
391371
with:
@@ -394,7 +374,7 @@ jobs:
394374

395375
- name: Install dependencies
396376
run: |
397-
poetry install --without py39-dev
377+
poetry install
398378
399379
# ====================== SETUP DEVNET ====================== #
400380

@@ -430,7 +410,7 @@ jobs:
430410
strategy:
431411
fail-fast: false
432412
matrix:
433-
python-version: [ "3.8", "3.9", "3.10", "3.11" ]
413+
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ]
434414
steps:
435415
- uses: actions/checkout@v3
436416
- uses: actions-rust-lang/setup-rust-toolchain@v1
@@ -444,7 +424,7 @@ jobs:
444424

445425
- uses: actions/setup-python@v4
446426
with:
447-
python-version: "3.9"
427+
python-version: "3.12"
448428
cache: 'pip'
449429

450430
# ====================== SETUP PYTHON ====================== #
@@ -455,11 +435,6 @@ jobs:
455435
pip install poetry
456436
poetry config installer.modern-installation false
457437
458-
- name: Install python 3.9 requirements
459-
run: |
460-
poetry export -f requirements.txt --only=py39-dev --without-hashes --output requirements.txt
461-
pip install -r requirements.txt
462-
463438
- name: Set up Python ${{ matrix.python-version }}
464439
uses: actions/setup-python@v4
465440
with:
@@ -468,7 +443,7 @@ jobs:
468443

469444
- name: Install dependencies
470445
run: |
471-
poetry install --without py39-dev
446+
poetry install
472447
473448
# ====================== SETUP DEVNET ====================== #
474449

.github/workflows/manual_tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ on:
1717
- '3.9'
1818
- '3.10'
1919
- '3.11'
20+
- '3.12'
2021

2122
jobs:
2223
setup:

docs/api/abi.rst

Lines changed: 63 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,86 @@ Abi
33

44
Module containing representation of contract abi and parser for creating it from parsed json.
55

6-
.. py:module:: starknet_py.abi
6+
.. py:module:: starknet_py.abi.v2
77
8-
Parsing abi
9-
-----------
8+
Parsing abi v2
9+
--------------
1010

1111
.. autoclass:: AbiParser
1212
:members: parse
1313

1414
.. autoclass:: AbiParsingError
1515
:exclude-members: __init__, __new__
1616

17-
Model
18-
-----------
17+
Model v2
18+
--------
19+
20+
.. autoclass:: Abi
21+
:exclude-members: __init__, __new__
22+
:members: defined_structures, functions, constructor, l1_handler, events, defined_enums, interfaces, implementations
23+
24+
.. autoclass:: starknet_py.abi.v2.Abi.Function
25+
:members:
26+
:undoc-members:
27+
:member-order: groupwise
28+
29+
.. autoclass:: starknet_py.abi.v2.Abi.Event
30+
:members:
31+
:undoc-members:
32+
:member-order: groupwise
33+
34+
.. py:module:: starknet_py.abi.v1
35+
36+
Parsing abi v1
37+
--------------
38+
39+
.. autoclass:: AbiParser
40+
:members: parse
41+
42+
.. autoclass:: AbiParsingError
43+
:exclude-members: __init__, __new__
44+
45+
Model v1
46+
--------
47+
48+
.. autoclass:: Abi
49+
:exclude-members: __init__, __new__
50+
:members: defined_structures, functions, events, defined_enums
51+
52+
.. autoclass:: starknet_py.abi.v1.Abi.Function
53+
:members:
54+
:undoc-members:
55+
:member-order: groupwise
56+
57+
.. autoclass:: starknet_py.abi.v1.Abi.Event
58+
:members:
59+
:undoc-members:
60+
:member-order: groupwise
61+
62+
.. py:module:: starknet_py.abi.v0
63+
64+
Parsing abi v0
65+
--------------
66+
67+
.. autoclass:: AbiParser
68+
:members: parse
69+
70+
.. autoclass:: AbiParsingError
71+
:exclude-members: __init__, __new__
72+
73+
Model v0
74+
--------
1975

2076
.. autoclass:: Abi
2177
:exclude-members: __init__, __new__
2278
:members: defined_structures, functions, constructor, l1_handler, events
2379

24-
.. autoclass:: starknet_py.abi.Abi.Function
80+
.. autoclass:: starknet_py.abi.v0.Abi.Function
2581
:members:
2682
:undoc-members:
2783
:member-order: groupwise
2884

29-
.. autoclass:: starknet_py.abi.Abi.Event
85+
.. autoclass:: starknet_py.abi.v0.Abi.Event
3086
:members:
3187
:undoc-members:
3288
:member-order: groupwise

docs/development.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ Development dependencies
99
------------------------
1010
- `poetry <https://python-poetry.org/>`_ - dependency manager.
1111
- `pyenv <https://github.com/pyenv/pyenv>`_ - recommended for installing and switching python versions locally.
12-
13-
Make sure running ``poetry run python --version`` returns ``Python 3.9.x``.
12+
- `cairo-lang <https://pypi.org/project/cairo-lang/>`_ - required to compile contracts (`poe compile_contracts`)
1413

1514
Setup
1615
-----

docs/guide/account_and_client.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ For V3 transactions, ``max_amount`` and ``max_price_per_unit`` are scaled by ``1
3636
by changing ``ESTIMATED_FEE_MULTIPLIER`` for V1 and V2 transactions in :class:`~starknet_py.net.account.account.Account`.
3737
The same applies to ``ESTIMATED_AMOUNT_MULTIPLIER`` and ``ESTIMATED_UNIT_PRICE_MULTIPLIER`` for V3 transactions.
3838

39+
The fee for a specific transaction or list of transactions can be also estimated using the :meth:`~starknet_py.net.account.account.Account.estimate_fee` of the :ref:`Account` class.
40+
3941
Creating transactions without executing them
4042
--------------------------------------------
4143

docs/guide/resolving_proxy_contracts.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ By default, ``proxy_config`` uses a configuration with two **ProxyChecks**:
3737
- ArgentProxyCheck - resolves `Argent Proxy <https://github.com/argentlabs/argent-contracts-starknet/blob/b7c4af7462a461386d29551400b985832ba942de/contracts/upgrade/Proxy.cairo>`_.
3838
- OpenZeppelinProxyCheck - resolves `OpenZeppelin Proxy <https://github.com/OpenZeppelin/cairo-contracts/blob/d12abf335f5c778fd19d6f99e91c099b40865deb/src/openzeppelin/upgrades/presets/Proxy.cairo>`_.
3939

40+
.. warning::
41+
``StarknetEthProxyCheck`` has been removed, because the StarkGate ETH Token was upgraded to Cairo 2, meaning it isn't a Proxy anymore. Currently, all StarkGate's Token contracts use interface of ERC20 to interact.
42+
4043
It's possible to define own ProxyCheck implementation and later pass it to :meth:`Contract.from_address <starknet_py.contract.Contract.from_address>`, so it knows how to resolve the Proxy.
4144

4245
The **ProxyCheck** base class implements the following interface:

docs/guide/serialization.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,10 @@ For most use cases using high level :obj:`Contract <starknet_py.contract.Contrac
8888
and deserialization for you. If you need more flexibility you can use lower level serialization API, see :ref:`Serializers`
8989
for more details.
9090

91-
:obj:`AbiParser <starknet_py.net.models.abi.parser.AbiParser>` transforms ABI into
92-
:obj:`Abi dataclass <starknet_py.net.models.abi.model.Abi>` that can be used for creating serializers. This way you can
93-
easily deserialize events or serialize function's inputs.
91+
:obj:`AbiParser <starknet_py.abi.v2.parser.AbiParser>` transforms ABI into
92+
:obj:`Abi class <starknet_py.abi.v2.model.Abi>` that can be used for creating serializers. This way you can
93+
easily deserialize events or serialize function's inputs. Remember to use the proper version of `AbiParser`
94+
which depends on parsed ABI version.
9495

9596
Serializing function inputs and outputs
9697
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

0 commit comments

Comments
 (0)