starknet-specs icon indicating copy to clipboard operation
starknet-specs copied to clipboard

RPC Spec for starknet_getEvents does not seem correct

Open claytonneal opened this issue 2 years ago • 5 comments

The rpc spec says that there is a "from_block" property, but in reality this has to be called "fromBlock" Also the spec says that the page_size and page_number are their own object, this is not true Example:

{ "jsonrpc": "2.0", "id": 0, "method": "starknet_getEvents", "params": [ { "fromBlock": { "block_number": 2271 }, "toBlock": { "block_number": 2272}, "page_size": 10, "page_number": 1 } ] }

--> "fromBlock" rather than "from_block" --> "page_size" / "page_number" are part of same object

Can you review and update. (Im using pathfinder v0.3.01)

Regards

claytonneal avatar Aug 26 '22 07:08 claytonneal

That would be a bug in pathfinder :) I'll open an issue and link it to this one.

Mirko-von-Leipzig avatar Aug 26 '22 07:08 Mirko-von-Leipzig

The page_size and page_number being part of the same object I think is intended as it is part of all_of?

~~Nevermind scratch that.~~

Mirko-von-Leipzig avatar Aug 26 '22 08:08 Mirko-von-Leipzig

hiya: in the spec there is:

"schema": {
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/EVENT_FILTER"
                            },
                            {
                                "$ref": "#/components/schemas/RESULT_PAGE_REQUEST"
                            }
                        ]
                    }

This suggests 2x objects, when in my request above its only 1

claytonneal avatar Aug 26 '22 08:08 claytonneal

I'm not sure that implies two objects? As I understand it, it implies there is a single object which complies with all of the below schema's.

Two objects would need explicit naming as separate properties.

Mirko-von-Leipzig avatar Aug 26 '22 08:08 Mirko-von-Leipzig

OK no probs, thanks for the linked issue

claytonneal avatar Aug 26 '22 08:08 claytonneal