Skip to content

Commit 308d42e

Browse files
Merge branch 'development'
2 parents 25bcbcb + c4d0474 commit 308d42e

Some content is hidden

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

57 files changed

+41728
-296
lines changed

.github/workflows/checks.yml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -227,15 +227,22 @@ jobs:
227227
uses: codecov/codecov-action@v3
228228

229229
# ---------------------------------------------------------- #
230-
# ..................RUN-TESTS-INTEGRATION................... #
230+
# ..................RUN-TESTS-ON-NETWORKS................... #
231231
# ---------------------------------------------------------- #
232232

233-
run-tests-integration:
234-
name: Tests on integration
233+
run-tests-on-networks:
234+
name: Tests on networks (testnet and integration)
235235
needs: setup-tests
236236
runs-on: ubuntu-latest
237237
strategy:
238238
fail-fast: false
239+
env:
240+
INTEGRATION_RPC_URL: ${{ secrets.INTEGRATION_RPC_URL }}
241+
TESTNET_RPC_URL: ${{ secrets.TESTNET_RPC_URL }}
242+
INTEGRATION_ACCOUNT_PRIVATE_KEY: ${{ secrets.INTEGRATION_ACCOUNT_PRIVATE_KEY }}
243+
INTEGRATION_ACCOUNT_ADDRESS: ${{ secrets.INTEGRATION_ACCOUNT_ADDRESS }}
244+
TESTNET_ACCOUNT_PRIVATE_KEY: ${{ secrets.TESTNET_ACCOUNT_PRIVATE_KEY }}
245+
TESTNET_ACCOUNT_ADDRESS: ${{ secrets.TESTNET_ACCOUNT_ADDRESS }}
239246
steps:
240247
- uses: actions/checkout@v3
241248

@@ -281,8 +288,8 @@ jobs:
281288
282289
- name: Run tests
283290
run: |
284-
poetry run poe test_ci_integration_full_node
285-
poetry run poe test_ci_integration_gateway
291+
poetry run poe test_ci_on_networks_full_node
292+
poetry run poe test_ci_on_networks_gateway
286293
287294
- name: Generate coverage in XML
288295
run: |
@@ -333,7 +340,7 @@ jobs:
333340
apt-get install -y python3-pip
334341
sudo apt install -y libgmp3-dev
335342
sudo apt-get install -y git
336-
pip3 install git+https://github.com/0xSpaceShard/starknet-devnet.git@v0.5.5
343+
pip3 install git+https://github.com/0xSpaceShard/starknet-devnet.git@v0.6.2
337344
338345
# ====================== SETUP PYTHON ====================== #
339346

@@ -485,7 +492,7 @@ jobs:
485492
apt-get install -y python3-pip
486493
sudo apt install -y libgmp3-dev
487494
sudo apt-get install -y git
488-
pip3 install git+https://github.com/0xSpaceShard/starknet-devnet.git@v0.5.5
495+
pip3 install git+https://github.com/0xSpaceShard/starknet-devnet.git@v0.6.2
489496
490497
# ====================== SETUP PYTHON ====================== #
491498

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,3 +154,4 @@ cython_debug/
154154

155155
# Cairo1 compiler manifest
156156
/starknet_py/tests/e2e/manifest-path
157+
/starknet_py/tests/e2e/test-variables.env

docs/development.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,31 @@ Make sure running ``poetry run python --version`` returns ``Python 3.9.x``.
1515
Setup
1616
-----
1717

18+
In order to run Cairo1 devnet tests and compile contracts in Cairo1 via poetry command,
19+
you need to create ``manifest-path`` file in ``starknet_py/tests/e2e/`` directory and pass the path in it to Cairo compiler.
20+
An example file - ``manifest-path.template`` is in the same directory. Additional info can be found in `devnet docs <https://0xspaceshard.github.io/starknet-devnet/docs/guide/cairo1-support>`_.
21+
22+
In order to be able to run tests on testnet and integration networks (``starknet_py/tests/e2e/tests_on_networks/``), you must set some environmental variables:
23+
24+
- ``INTEGRATION_RPC_URL``
25+
- ``TESTNET_RPC_URL``
26+
- ``INTEGRATION_ACCOUNT_PRIVATE_KEY``
27+
- ``INTEGRATION_ACCOUNT_ADDRESS``
28+
- ``TESTNET_ACCOUNT_PRIVATE_KEY``
29+
- ``TESTNET_ACCOUNT_ADDRESS``
30+
31+
The best way to do that is to create ``test-variables.env`` file in ``starknet_py/tests/e2e/`` directory, so they can be loaded by the ``python-dotenv`` library.
32+
You can find an example file ``test-variables.env.template`` in the same directory with the format of how it should look like.
33+
1834
.. code-block:: bash
1935
2036
# Install dependencies
2137
poetry install
2238
2339
# Compile contracts
2440
poe compile_contracts
41+
poe compile_contracts_v1
42+
poe compile_contracts_v2
2543
2644
# Make sure everything was installed properly
2745
poe test

docs/migration_guide.rst

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,112 @@
11
Migration guide
22
===============
33

4+
**********************
5+
0.18.2 Migration guide
6+
**********************
7+
8+
Version 0.18.2 of **starknet.py** comes with support of `RPC v0.4.0 <https://github.com/starkware-libs/starknet-specs/releases/tag/v0.4.0>`_ Trace API!
9+
Additionally, you can now `properly` use Cairo1 accounts! ``starknet.py`` automatically checks if your account is in Cairo1 and
10+
sets the calldata encoding accordingly.
11+
12+
0.18.2 Targeted versions
13+
------------------------
14+
15+
- Starknet - `0.12.2 <https://community.starknet.io/t/introducing-p2p-authentication-and-mismatch-resolution-in-v0-12-2/97993>`_
16+
- RPC - `0.4.0 <https://github.com/starkware-libs/starknet-specs/releases/tag/v0.4.0>`_
17+
18+
0.18.2 Breaking changes
19+
-----------------------
20+
21+
.. currentmodule:: starknet_py.net.client
22+
23+
1. :meth:`Client.get_block_traces` has been renamed to :meth:`Client.trace_block_transactions` in order to match RPC specification.
24+
25+
26+
0.18.2 Deprecations
27+
-------------------
28+
29+
.. currentmodule:: starknet_py.net.account.account
30+
31+
1. ``cairo_version`` parameter in :meth:`Account.sign_invoke_transaction` and :meth:`Account.execute` has been deprecated.
32+
33+
34+
0.18.2 Bugfixes
35+
---------------
36+
37+
.. currentmodule:: starknet_py.contract
38+
39+
1. Fixed a bug when using ``proxy_config=True`` in :meth:`Contract.from_address` method regarding ``Entry point EntryPointSelector(...) not found in contract``.
40+
41+
0.18.2 Minor changes
42+
--------------------
43+
44+
1. :meth:`Client.trace_block_transactions` return type has been changed from ``BlockTransactionTraces`` to ``Union[BlockTransactionTraces, List[BlockTransactionTrace]]``.
45+
46+
.. currentmodule:: starknet_py.net.gateway_client
47+
48+
2. ``include_block`` parameter in :meth:`GatewayClient.get_state_update` now works on gateway mainnet.
49+
50+
.. currentmodule:: starknet_py.net.account.account
51+
52+
3. :class:`BaseAccount` interface and :class:`Account` now have an additional **async** property - ``cairo_version``.
53+
54+
55+
0.18.2 Development-related changes
56+
----------------------------------
57+
58+
1. In order to be able to run tests, you must set some environmental variables:
59+
60+
- ``INTEGRATION_RPC_URL``
61+
- ``TESTNET_RPC_URL``
62+
- ``INTEGRATION_ACCOUNT_PRIVATE_KEY``
63+
- ``INTEGRATION_ACCOUNT_ADDRESS``
64+
- ``TESTNET_ACCOUNT_PRIVATE_KEY``
65+
- ``TESTNET_ACCOUNT_ADDRESS``
66+
67+
The best way to do that is to create ``test-variables.env`` file in ``starknet_py/tests/e2e/`` directory, so they can be loaded by the ``python-dotenv`` library.
68+
You can find an example file ``test-variables.env.template`` in the same directory with the format of how it should look like.
69+
70+
71+
|
72+
73+
.. raw:: html
74+
75+
<hr>
76+
77+
|
78+
79+
**********************
80+
0.18.1 Migration guide
81+
**********************
82+
83+
.. currentmodule:: starknet_py.net.gateway_client
84+
85+
This version contains a quick fix to :meth:`GatewayClient.get_state_update` method (mainnet wasn't updated to 0.12.2 then).
86+
87+
.. currentmodule:: starknet_py.net.account.account
88+
89+
Additionally, accounts in Cairo1 are now supported! You can pass additional argument ``cairo_version`` to :meth:`Account.sign_invoke_transaction` method.
90+
91+
92+
0.18.1 Minor changes
93+
--------------------
94+
95+
1. Parameter ``include_block`` in :meth:`GatewayClient.get_state_update` doesn't work on mainnet gateway (an error is thrown).
96+
97+
.. currentmodule:: starknet_py.net.account.account
98+
99+
2. :meth:`Account.sign_invoke_transaction` now accepts additional parameter ``cairo_version``, which allows specifying which type of calldata encoding should be used.
100+
101+
|
102+
103+
.. raw:: html
104+
105+
<hr>
106+
107+
|
108+
109+
4110
**********************
5111
0.18.0 Migration guide
6112
**********************

0 commit comments

Comments
 (0)