Skip to content
This repository has been archived by the owner on Dec 15, 2023. It is now read-only.

Renamed transaction param for rpc simulateTransactions #499

Merged
merged 2 commits into from
Jun 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions starknet_devnet/blueprints/rpc/rpc_trace_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@
}
},
{
"name": "transaction",
"description": "The transaction to simulate",
"name": "transactions",
"description": "The transactions to simulate",
"required": true,
"schema": {
"type": "array",
Expand Down
4 changes: 2 additions & 2 deletions starknet_devnet/blueprints/rpc/transactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,15 +220,15 @@ async def estimate_fee(request: List[RpcBroadcastedTxn], block_id: BlockId) -> l
@validate_schema("simulateTransaction")
async def simulate_transaction(
block_id: BlockId,
transaction: List[RpcTransaction],
transactions: List[RpcTransaction],
simulation_flags: List[SimulationFlag],
) -> list:
"""
Simulate transactions.
SKIP_EXECUTE SimulationFlag is not supported.
"""
await assert_block_id_is_valid(block_id)
transactions = list(map(make_transaction, transaction))
transactions = list(map(make_transaction, transactions))
skip_validate = SimulationFlag.SKIP_VALIDATE.name in simulation_flags
skip_execute = SimulationFlag.SKIP_EXECUTE.name in simulation_flags
simulated_transactions = []
Expand Down
18 changes: 9 additions & 9 deletions test/rpc/test_rpc_traces.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def test_skip_execute_flag(deploy_account_details):
"starknet_simulateTransaction",
{
"block_id": "latest",
"transaction": [rpc_deploy_account_tx],
"transactions": [rpc_deploy_account_tx],
"simulation_flags": [SimulationFlag.SKIP_EXECUTE.name],
},
)
Expand Down Expand Up @@ -87,15 +87,15 @@ def test_simulate_transaction_invoke():
"starknet_simulateTransaction",
{
"block_id": "latest",
"transaction": [invoke_transaction],
"transactions": [invoke_transaction],
"simulation_flags": [],
},
)["result"][0]
response_skip_flag = rpc_call_background_devnet(
"starknet_simulateTransaction",
{
"block_id": "latest",
"transaction": [invoke_transaction],
"transactions": [invoke_transaction],
"simulation_flags": [SimulationFlag.SKIP_VALIDATE.name],
},
)["result"][0]
Expand Down Expand Up @@ -157,15 +157,15 @@ def test_simulate_transaction_declare_v1(declare_content):
"starknet_simulateTransaction",
{
"block_id": "latest",
"transaction": [declare_transaction],
"transactions": [declare_transaction],
"simulation_flags": [],
},
)["result"][0]
response_skip_flag = rpc_call_background_devnet(
"starknet_simulateTransaction",
{
"block_id": "latest",
"transaction": [declare_transaction],
"transactions": [declare_transaction],
"simulation_flags": [SimulationFlag.SKIP_VALIDATE.name],
},
)["result"][0]
Expand Down Expand Up @@ -215,15 +215,15 @@ def test_simulate_transaction_declare_v2():
"starknet_simulateTransaction",
{
"block_id": "latest",
"transaction": [declare_transaction],
"transactions": [declare_transaction],
"simulation_flags": [],
},
)["result"][0]
response_skip_flag = rpc_call_background_devnet(
"starknet_simulateTransaction",
{
"block_id": "latest",
"transaction": [declare_transaction],
"transactions": [declare_transaction],
"simulation_flags": [SimulationFlag.SKIP_VALIDATE.name],
},
)["result"][0]
Expand Down Expand Up @@ -251,15 +251,15 @@ def test_simulate_transaction_deploy_account(deploy_account_details):
"starknet_simulateTransaction",
{
"block_id": "latest",
"transaction": [rpc_deploy_account_tx],
"transactions": [rpc_deploy_account_tx],
"simulation_flags": [],
},
)["result"][0]
response_skip_flag = rpc_call_background_devnet(
"starknet_simulateTransaction",
{
"block_id": "latest",
"transaction": [rpc_deploy_account_tx],
"transactions": [rpc_deploy_account_tx],
"simulation_flags": [SimulationFlag.SKIP_VALIDATE.name],
},
)["result"][0]
Expand Down