diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 8cc35200c..a8aa4e273 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -219,18 +219,15 @@ jobs: # ---------------------------------------------------------- # run-tests-on-networks: - name: Tests on networks (testnet and integration) + name: Tests on networks (testnet) needs: setup-tests runs-on: ubuntu-latest strategy: fail-fast: false env: - SEPOLIA_INTEGRATION_RPC_URL: ${{ secrets.SEPOLIA_INTEGRATION_RPC_URL }} SEPOLIA_RPC_URL: ${{ secrets.SEPOLIA_RPC_URL }} SEPOLIA_ACCOUNT_ADDRESS: ${{ secrets.SEPOLIA_ACCOUNT_ADDRESS }} SEPOLIA_ACCOUNT_PRIVATE_KEY: ${{ secrets.SEPOLIA_ACCOUNT_PRIVATE_KEY }} - SEPOLIA_INTEGRATION_ACCOUNT_PRIVATE_KEY: ${{ secrets.SEPOLIA_INTEGRATION_ACCOUNT_PRIVATE_KEY }} - SEPOLIA_INTEGRATION_ACCOUNT_ADDRESS: ${{ secrets.SEPOLIA_INTEGRATION_ACCOUNT_ADDRESS }} steps: - uses: actions/checkout@v4 diff --git a/docs/development.rst b/docs/development.rst index 268431e88..10bba5167 100644 --- a/docs/development.rst +++ b/docs/development.rst @@ -23,12 +23,9 @@ To install `starknet-devnet-rs L2 interaction." ): - await client_sepolia_integration.get_l1_message_hash(tx_hash) + await client_sepolia_testnet.get_l1_message_hash(tx_hash) @pytest.mark.asyncio @@ -399,13 +377,6 @@ async def test_get_chain_id_sepolia_testnet(client_sepolia_testnet): assert chain_id == hex(StarknetChainId.SEPOLIA.value) -@pytest.mark.asyncio -async def test_get_chain_id_sepolia_integration(client_sepolia_integration): - chain_id = await client_sepolia_integration.get_chain_id() - assert isinstance(chain_id, str) - assert chain_id == hex(StarknetChainId.SEPOLIA_INTEGRATION.value) - - @pytest.mark.asyncio async def test_get_events_sepolia_testnet(client_sepolia_testnet): events_chunk = await client_sepolia_testnet.get_events( @@ -425,21 +396,6 @@ async def test_get_events_sepolia_testnet(client_sepolia_testnet): assert events_chunk.events[0].keys is not None -@pytest.mark.asyncio -async def test_get_tx_receipt_with_execution_resources(client_sepolia_integration): - receipt = await client_sepolia_integration.get_transaction_receipt( - tx_hash=0x077E84B7C0C4CC88B778EEAEF32B7CED4500FE4AAEE62FD2F849B7DD90A87826 - ) - - assert receipt.execution_resources is not None - assert receipt.execution_resources.data_availability is not None - assert receipt.execution_resources.steps is not None - assert receipt.execution_resources.bitwise_builtin_applications is not None - assert receipt.execution_resources.ec_op_builtin_applications is not None - assert receipt.execution_resources.pedersen_builtin_applications is not None - assert receipt.execution_resources.range_check_builtin_applications is not None - - @pytest.mark.asyncio async def test_get_block_with_receipts(client_sepolia_testnet): block_with_receipts = await client_sepolia_testnet.get_block_with_receipts( @@ -456,8 +412,8 @@ async def test_get_block_with_receipts(client_sepolia_testnet): @pytest.mark.asyncio -async def test_get_pending_block_with_receipts(client_sepolia_integration): - block_with_receipts = await client_sepolia_integration.get_block_with_receipts( +async def test_get_pending_block_with_receipts(client_sepolia_testnet): + block_with_receipts = await client_sepolia_testnet.get_block_with_receipts( block_number="pending" ) diff --git a/starknet_py/tests/e2e/tests_on_networks/fixtures.py b/starknet_py/tests/e2e/tests_on_networks/fixtures.py index d2cbcc930..7cac4397d 100644 --- a/starknet_py/tests/e2e/tests_on_networks/fixtures.py +++ b/starknet_py/tests/e2e/tests_on_networks/fixtures.py @@ -7,35 +7,15 @@ from starknet_py.tests.e2e.fixtures.constants import ( SEPOLIA_ACCOUNT_ADDRESS, SEPOLIA_ACCOUNT_PRIVATE_KEY, - SEPOLIA_INTEGRATION_ACCOUNT_ADDRESS, - SEPOLIA_INTEGRATION_ACCOUNT_PRIVATE_KEY, - SEPOLIA_INTEGRATION_RPC_URL, SEPOLIA_RPC_URL, ) -@pytest.fixture(scope="package") -def client_sepolia_integration() -> FullNodeClient: - return FullNodeClient(node_url=SEPOLIA_INTEGRATION_RPC_URL()) - - @pytest.fixture(scope="package") def client_sepolia_testnet() -> FullNodeClient: return FullNodeClient(node_url=SEPOLIA_RPC_URL()) -@pytest.fixture(scope="package") -def account_sepolia_integration(client_sepolia_integration) -> Account: - return Account( - address=SEPOLIA_INTEGRATION_ACCOUNT_ADDRESS(), - client=client_sepolia_integration, - key_pair=KeyPair.from_private_key( - int(SEPOLIA_INTEGRATION_ACCOUNT_PRIVATE_KEY(), 0) - ), - chain=StarknetChainId.SEPOLIA_INTEGRATION, - ) - - @pytest.fixture(scope="package") def account_sepolia_testnet(client_sepolia_testnet) -> Account: return Account( diff --git a/starknet_py/tests/e2e/tests_on_networks/trace_api_test.py b/starknet_py/tests/e2e/tests_on_networks/trace_api_test.py index 22482f4f5..a194e3107 100644 --- a/starknet_py/tests/e2e/tests_on_networks/trace_api_test.py +++ b/starknet_py/tests/e2e/tests_on_networks/trace_api_test.py @@ -15,39 +15,35 @@ L1HandlerTransactionTrace, RevertedFunctionInvocation, ) -from starknet_py.tests.e2e.fixtures.constants import CONTRACTS_COMPILED_V0_DIR -from starknet_py.tests.e2e.fixtures.misc import read_contract - -# TODO (#1219): move those tests to full_node_test.py @pytest.mark.asyncio -async def test_trace_transaction_invoke_v1(client_sepolia_integration): - invoke_tx_hash = 0x051506589B6D8900016B8E7362BDD07EE379F51127855DD0829E0768446C469C - trace = await client_sepolia_integration.trace_transaction(tx_hash=invoke_tx_hash) - tx = await client_sepolia_integration.get_transaction(tx_hash=invoke_tx_hash) - assert (type(tx)) is InvokeTransactionV1 +async def test_trace_transaction_invoke_v1(client_sepolia_testnet): + invoke_tx_hash = 0x6D1938DC27FF335BA1D585B2FD78C12C30EF12A25E0DD64461ECD2089F5F839 + trace = await client_sepolia_testnet.trace_transaction(tx_hash=invoke_tx_hash) + tx = await client_sepolia_testnet.get_transaction(tx_hash=invoke_tx_hash) + assert type(tx) is InvokeTransactionV1 assert type(trace) is InvokeTransactionTrace assert trace.execute_invocation is not None assert trace.execution_resources is not None @pytest.mark.asyncio -async def test_trace_transaction_invoke_v3(client_sepolia_integration): - invoke_tx_hash = 0x022FFB771D8B847899C49F8EFE48B4D70FD4825658E3D41AD38D3D3DA3045891 - trace = await client_sepolia_integration.trace_transaction(tx_hash=invoke_tx_hash) - tx = await client_sepolia_integration.get_transaction(tx_hash=invoke_tx_hash) - assert (type(tx)) is InvokeTransactionV3 +async def test_trace_transaction_invoke_v3(client_sepolia_testnet): + invoke_tx_hash = 0x26476DA48E56E5E7025543AD0BB9105DF00EE08571C6D17C4207462FF7717C4 + trace = await client_sepolia_testnet.trace_transaction(tx_hash=invoke_tx_hash) + tx = await client_sepolia_testnet.get_transaction(tx_hash=invoke_tx_hash) + assert type(tx) is InvokeTransactionV3 assert type(trace) is InvokeTransactionTrace assert trace.execute_invocation is not None assert trace.execution_resources is not None @pytest.mark.asyncio -async def test_trace_transaction_declare_v1(client_sepolia_integration): - declare_tx_hash = 0x0544A629990D2BED8CCF11910B30F2F1E18228ED5BE06660BEA20CAE13B2ACED - trace = await client_sepolia_integration.trace_transaction(tx_hash=declare_tx_hash) - tx = await client_sepolia_integration.get_transaction(tx_hash=declare_tx_hash) +async def test_trace_transaction_declare_v1(client_sepolia_testnet): + declare_tx_hash = 0x5E27AAD6F9139F6EEB0EE886179C40B551E91AD8BCC80E16FF0FE6D5444D6F9 + trace = await client_sepolia_testnet.trace_transaction(tx_hash=declare_tx_hash) + tx = await client_sepolia_testnet.get_transaction(tx_hash=declare_tx_hash) assert (type(tx)) is DeclareTransactionV1 assert type(trace) is DeclareTransactionTrace @@ -55,10 +51,10 @@ async def test_trace_transaction_declare_v1(client_sepolia_integration): @pytest.mark.asyncio -async def test_trace_transaction_declare_v2(client_sepolia_integration): - declare_tx_hash = 0x03CD7F3F1EB964BC5DD4AC466A0E8A3AEC936EB75D244CC88DFCE2DC97885317 - trace = await client_sepolia_integration.trace_transaction(tx_hash=declare_tx_hash) - tx = await client_sepolia_integration.get_transaction(tx_hash=declare_tx_hash) +async def test_trace_transaction_declare_v2(client_sepolia_testnet): + declare_tx_hash = 0x1B8EA3EB7A4F6FAB922C91CF672F5881EE71F43C050BEFBA5629B22A6552F9B + trace = await client_sepolia_testnet.trace_transaction(tx_hash=declare_tx_hash) + tx = await client_sepolia_testnet.get_transaction(tx_hash=declare_tx_hash) assert (type(tx)) is DeclareTransactionV2 assert type(trace) is DeclareTransactionTrace @@ -67,7 +63,7 @@ async def test_trace_transaction_declare_v2(client_sepolia_integration): @pytest.mark.asyncio async def test_trace_transaction_declare_v3(client_sepolia_testnet): - declare_tx_hash = 0x00EFE9482CE6511F3F23B472DD1210336177944B4F3142BF508BA1FCDB2CF75A + declare_tx_hash = 0x6054540622D534FFFFB162A0E80C21BC106581EAFEB3EFAD29385B78E04983D trace = await client_sepolia_testnet.trace_transaction(tx_hash=declare_tx_hash) tx = await client_sepolia_testnet.get_transaction(tx_hash=declare_tx_hash) @@ -77,16 +73,14 @@ async def test_trace_transaction_declare_v3(client_sepolia_testnet): @pytest.mark.asyncio -async def test_trace_transaction_deploy_account_v1(client_sepolia_integration): +async def test_trace_transaction_deploy_account_v1(client_sepolia_testnet): deploy_account_tx_hash = ( - 0x012DEBAE2435EA43C06610A31CCF8E7EA5DE9AEC43DAC7C7AA86905B4CCDEC49 + 0x5943A2831021BF5A7EE732D1C0D572487013B9DB0A17481A46B3D9206BD5082 ) - trace = await client_sepolia_integration.trace_transaction( - tx_hash=deploy_account_tx_hash - ) - tx = await client_sepolia_integration.get_transaction( + trace = await client_sepolia_testnet.trace_transaction( tx_hash=deploy_account_tx_hash ) + tx = await client_sepolia_testnet.get_transaction(tx_hash=deploy_account_tx_hash) assert (type(tx)) is DeployAccountTransactionV1 assert type(trace) is DeployAccountTransactionTrace @@ -111,14 +105,12 @@ async def test_trace_transaction_deploy_account_v3(client_sepolia_testnet): @pytest.mark.asyncio -async def test_trace_transaction_l1_handler(client_sepolia_integration): +async def test_trace_transaction_l1_handler(client_sepolia_testnet): l1_handler_tx_hash = ( - 0x07A00541410D41A98068D61905EB2440839A8BDD077BFB8B88C09478E3821CA6 - ) - trace = await client_sepolia_integration.trace_transaction( - tx_hash=l1_handler_tx_hash + 0x4C8C57B3AB646EF56AEF3DEF69A01BC86D049B98F25EBFE3699334D86C24D5 ) - tx = await client_sepolia_integration.get_transaction(tx_hash=l1_handler_tx_hash) + trace = await client_sepolia_testnet.trace_transaction(tx_hash=l1_handler_tx_hash) + tx = await client_sepolia_testnet.get_transaction(tx_hash=l1_handler_tx_hash) assert (type(tx)) is L1HandlerTransaction assert type(trace) is L1HandlerTransactionTrace @@ -127,42 +119,23 @@ async def test_trace_transaction_l1_handler(client_sepolia_integration): @pytest.mark.asyncio -async def test_trace_transaction_reverted(client_sepolia_integration): - tx_hash = 0x07DFF357E943748978B79DDD4A343A216F84B44154426CCB4CFD9C204858B15B - trace = await client_sepolia_integration.trace_transaction(tx_hash=tx_hash) +async def test_trace_transaction_reverted(client_sepolia_testnet): + tx_hash = 0x00FECCA6A328DD11F40B79C30FE22D23BC6975D1A0923A95B90AFF4016A84333 + trace = await client_sepolia_testnet.trace_transaction(tx_hash=tx_hash) assert isinstance(trace.execute_invocation, RevertedFunctionInvocation) @pytest.mark.asyncio -async def test_get_block_traces(client_sepolia_integration): - block_number = 13001 - block_transaction_traces = ( - await client_sepolia_integration.trace_block_transactions( - block_number=block_number - ) +async def test_get_block_traces(client_sepolia_testnet): + block_number = 80000 + block_transaction_traces = await client_sepolia_testnet.trace_block_transactions( + block_number=block_number ) - block = await client_sepolia_integration.get_block(block_number=block_number) + block = await client_sepolia_testnet.get_block(block_number=block_number) assert len(block_transaction_traces) == len(block.transactions) for i in range(len(block_transaction_traces)): assert ( block_transaction_traces[i].transaction_hash == block.transactions[i].hash ) - - -@pytest.mark.asyncio -async def test_simulate_transactions_declare_on_network(account_sepolia_integration): - compiled_contract = read_contract( - "map_compiled.json", directory=CONTRACTS_COMPILED_V0_DIR - ) - declare_tx = await account_sepolia_integration.sign_declare_v1( - compiled_contract, max_fee=int(1e16) - ) - - simulated_txs = await account_sepolia_integration.client.simulate_transactions( - transactions=[declare_tx] - ) - - assert isinstance(simulated_txs[0].transaction_trace, DeclareTransactionTrace) - assert simulated_txs[0].fee_estimation.overall_fee > 0