0xSpaceShard / starknet-devnet-rs

A local testnet for Starknet... in Rust
https://0xspaceshard.github.io/starknet-devnet-rs/
MIT License
104 stars 61 forks source link

/create_block endpoint (shardlabs/starknet-devnet-rs:0.2.0-rc.2) #598

Closed tabaktoni closed 1 week ago

tabaktoni commented 1 week ago

Describe the bug (observed vs expected behavior) devnet endpoint /create_block requires a user to provide body and header parameters on post-request. This differs from the rc.1 version, which didn't require any POST setup.

As documentation does not mention this setup it would be expected that /create_block works without a header and empty body

Not reproducible on testnet

To Reproduce

WORKING EXAMPLE: curl -d '{}' -H "Content-Type: application/json" -X POST http://localhost:5050/create_block {"block_hash":"0x21110b83d16f66132199ceb27fb43785763737c566e81d657c80824ce0be17a"}%

NO BODY: curl -H "Content-Type: application/json" -X POST http://localhost:5050/create_block Failed to parse the request body as JSON: EOF while parsing a value at line 1 column 0%

NO HEADER: curl -X POST http://localhost:5050/create_block Expected request with Content-Type: application/json% (edited) Devnet version