Repository: 0xSpaceShard/starknet-devnet (language: python)

Issue:
issue with positional parameter in JSON-RPC with starknet_addInvokeTransaction
When I run the following RPC call with positional parameter and `starknet_addInvokeTransaction`, I got an error saying `int() can't convert non-string with explicit base`. This is not happening with other verbs (at least those I have tested). I cannot really workaround that issue because the go ethereum JSON-RPC client does not support positional parameters. 

This is the request that is failing:

```shell
curl -H 'Content-Type: application/json' \
-d '{
    "id": 6,
    "jsonrpc": "2.0",
    "method": "starknet_addInvokeTransaction",
    "params": [
        {
            "calldata": [
                "0x1",
                "0x35a55a64238b776664d7723de1f6b50350116a1ab1ca1fe154320a0eba53d3a",
                "0x7a44dde9fea32737a5cf3f9683b3235138654aa2d189f6fe44af37a61dc60d",
                "0x0",
                "0x0",
                "0x0",
                "0x0"
            ],
            "contract_address": "0x6bb9425718d801fd06f144abb82eced725f0e81db61d2f9f4c9a26ece46a829",
            "entry_point_selector": "0x15d40a3d6ca2ac30f4031e42be28da9b056fef9bb7357ac5e85627ee876e5ad"
        },
        [
            "0x43d30855910c7923b4ebd55c5b51edb2b8a220a0ddd6c3b71f69e7f55f7b838",
            "0x40f65b1dc85eea253de3d7c29a7ae6a77f4ab18e30ccc0255a8fe97e5f2c679"
        ],
        "0x47e82c3a41000",
        "0x0"
    ]
}' http://localhost:5050/rpc
```

And the error:

```text
{"error":{"code":22,"message":"int() can't convert non-string with explicit base"},"id":6,"jsonrpc":"2.0"}
```

If I do the exact same request with named parameters it just works. This is the conversion:

```shell
curl -H 'Content-Type: application/json' \
-d '{
    "id": 6,
    "jsonrpc": "2.0",
    "method": "starknet_addInvokeTransaction",
    "params": {
        "function_invocation": {
            "calldata": [
                "0x1",
                "0x35a55a64238b776664d7723de1f6b50350116a1ab1ca1fe154320a0eba53d3a",
                "0x7a44dde9fea32737a5cf3f9683b3235138654aa2d189f6fe44af37a61dc60d",
                "0x0",
                "0x0",
                "0x0",
                "0x0"
            ],
            "contract_address": "0x6bb9425718d801fd06f144abb82eced725f0e81db61d2f9f4c9a26ece46a829",
            "entry_point_selector": "0x15d40a3d6ca2ac30f4031e42be28da9b056fef9bb7357ac5e85627ee876e5ad"
        },
        "signature": [
            "0x43d30855910c7923b4ebd55c5b51edb2b8a220a0ddd6c3b71f69e7f55f7b838",
            "0x40f65b1dc85eea253de3d7c29a7ae6a77f4ab18e30ccc0255a8fe97e5f2c679"
        ],
        "max_fee": "0x47e82c3a41000",
        "version": "0x0"
    }
}' http://localhost:5050/rpc
```

and the succeeding message

```text
{"id":6,"jsonrpc":"2.0","result":{"transaction_hash":"0x0520ab17164331c43c358d92862ff9b2a1f501690179b32828f4ea3bf9617012"}}
```
A clear and concise description of what the bug is. If applicable, add screenshots to help explain your problem. However, prefer providing plain text.

**Not reproducible on alpha-goerli**

- [x] This issue is only present on Devnet and cannot be reproduced on alpha-goerli (check the box if true).

**To Reproduce**
Steps to reproduce the behavior:
Run a `starknet_addInvokeTransaction` with positional parameters. See request above

**Devnet version**

- I am using Devnet version: 0.3.1
- [x] This happens with a dockerized Devnet (check the box if true).
- This does not appear on the following Devnet version: N/A

**System specifications**

- OS: Linux
- CPU: 2
- Memory: 8G
- Python version: 3.9



Discussion / hints:

Fix patch:
diff --git a/starknet_devnet/blueprints/rpc/transactions.py b/starknet_devnet/blueprints/rpc/transactions.py
index 109c2af71..67a317664 100644
--- a/starknet_devnet/blueprints/rpc/transactions.py
+++ b/starknet_devnet/blueprints/rpc/transactions.py
@@ -3,7 +3,7 @@
 """
 
 import dataclasses
-from typing import List, Optional
+from typing import List
 
 from marshmallow.exceptions import MarshmallowError
 from starkware.starknet.services.api.contract_class import ContractClass
@@ -106,10 +106,10 @@ async def pending_transactions() -> List[RpcTransaction]:
 
 async def add_invoke_transaction(
     function_invocation: FunctionCall,
+    signature: List[Felt],
     max_fee: NumAsHex,
     version: NumAsHex,
     nonce: NumAsHex = None,
-    signature: Optional[List[Felt]] = None,
 ) -> dict:
     """
     Submit a new transaction to be added to the chain


Test patch:
diff --git a/test/rpc/test_rpc_transactions.py b/test/rpc/test_rpc_transactions.py
index c585e29ba..6ba6b0c73 100644
--- a/test/rpc/test_rpc_transactions.py
+++ b/test/rpc/test_rpc_transactions.py
@@ -313,6 +313,32 @@ def test_add_invoke_transaction(invoke_content):
     assert set(receipt.keys()) == {"transaction_hash"}
     assert receipt["transaction_hash"][:3] == "0x0"
 
+@pytest.mark.usefixtures("run_devnet_in_background")
+def test_add_invoke_transaction_positional_args(invoke_content):
+    """
+    Add invoke transaction
+    """
+    resp = rpc_call(
+        "starknet_addInvokeTransaction",
+        params=[
+            {
+                "contract_address": pad_zero(invoke_content["contract_address"]),
+                "entry_point_selector": pad_zero(
+                    invoke_content["entry_point_selector"]
+                ),
+                "calldata": [
+                    pad_zero(hex(int(data))) for data in invoke_content["calldata"]
+                ],
+            },
+            [pad_zero(sig) for sig in invoke_content["signature"]],
+            hex(0),
+            hex(SUPPORTED_RPC_TX_VERSION),
+        ],
+    )
+    receipt = resp["result"]
+
+    assert set(receipt.keys()) == {"transaction_hash"}
+    assert receipt["transaction_hash"][:3] == "0x0"
 
 @pytest.mark.usefixtures("run_devnet_in_background")
 def test_add_declare_transaction_on_incorrect_contract(declare_content):