juno icon indicating copy to clipboard operation
juno copied to clipboard

`starknet_getStateUpdate` returns decimal representations of field elements

Open tshakalekholoane opened this issue 3 years ago • 0 comments

The JSON RPC method starknet_getStateUpdate returns decimal formatted strings in its output. For example the following request:

{
  "jsonrpc": "2.0",
  "method": "starknet_getStateUpdate",
  "params": [
    0
  ],
  "id": 1
}

Returns the following response:

{
  "jsonrpc": "2.0",
  "result": {
    "storage_diffs": {
      "1407352284783671026127653444689025405903785508685418552906528356004194896722": [
        {
          "key": "394289168167265445374632363466357133981865040396795598116421516872827652841",
          "Value": "570920402159267707065786439757248226918653058110349152410418921644075880512"
        },
        {
          "key": "2698533540911089821226508289542548328632057663796456292913373387133967093855",
          "Value": 1991
        }
      ],
// ...

Note that some values are also formatted as JSON numbers instead of strings.

Heads up: This method will also panic when executed without enabling the synchronisation process. See #353 for details.

tshakalekholoane avatar Aug 19 '22 14:08 tshakalekholoane