typings
typings copied to clipboard
Invalid Rust bindings are generated
I tried generating Rust bindings for this openrpc.json: https://raw.githubusercontent.com/ethereum/execution-apis/v1.0.0-beta.1/refs-openrpc.json; but it resulted in invalid Rust code.
The problems I'm seeing:
- [ ] duplicate Rust types (https://github.com/open-rpc/typings/issues/42 mentions this having been resolved for Rust)
- [ ] cyclic type definitions
results in this Rust code:{ "name": "rewardPercentiles", "description": "A monotonically increasing list of percentile values. For each block in the requested range, the transactions will be sorted in ascending order by effective tip per gas and the coresponding effective tip for the percentile will be determined, accounting for gas consumed.", "required": true, "schema": { "title": "rewardPercentiles", "type": "array", "items": { "title": "rewardPercentile", "description": "Floating point value between 0 and 100.", "type": "number" } } }
where I would have expected something like:pub type RewardPercentiles = Vec<RewardPercentile>;pub type RewardPercentiles = Vec<u32>; - [ ] functions are generated without a body. E.g.
pub fn EthGetBlockByHash(&mut self, Block hash: 2ByteHexValue, Hydrated transactions: Hydrated) -> RpcRequest<BlockObject>;