Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid Rust bindings are generated #461

Open
3 tasks
Wodann opened this issue Sep 24, 2022 · 0 comments
Open
3 tasks

Invalid Rust bindings are generated #461

Wodann opened this issue Sep 24, 2022 · 0 comments

Comments

@Wodann
Copy link

Wodann commented Sep 24, 2022

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 (Duplicate typings in typescript #42 mentions this having been resolved for Rust)
  • cyclic type definitions
     {
     	"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"
     		}
     	}
     }
    
    results in this Rust code:
    pub type RewardPercentiles = Vec<RewardPercentile>;
    
    where I would have expected something like:
    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>;
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant