Skip to content

Commit

Permalink
codegen
Browse files Browse the repository at this point in the history
  • Loading branch information
pgherveou committed Jan 10, 2025
1 parent f3ab385 commit ae59158
Show file tree
Hide file tree
Showing 10 changed files with 4,507 additions and 0 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,7 @@ members = [
"substrate/frame/revive/mock-network",
"substrate/frame/revive/proc-macro",
"substrate/frame/revive/rpc",
"substrate/frame/revive/rpc/codegen",
"substrate/frame/revive/uapi",
"substrate/frame/root-offences",
"substrate/frame/root-testing",
Expand Down
13 changes: 13 additions & 0 deletions prdoc/pr_5926.prdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Schema: Polkadot SDK PRDoc Schema (prdoc) v1.0.0
# See doc at https://raw.githubusercontent.com/paritytech/polkadot-sdk/master/prdoc/schema_user.json

title: "[pallet-revive] add codegen for Ethereum RPC API"

doc:
- audience: Runtime Dev
description: |
Add codegen crate for generating Ethereum RPC methods and types from the spec.

crates:
- name: pallet-revive-rpc-codegen
bump: patch
18 changes: 18 additions & 0 deletions substrate/frame/revive/rpc/codegen/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[package]
name = "pallet-revive-rpc-codegen"
version = "0.1.0"
edition.workspace = true
publish = false

[dependencies]
Inflector = { workspace = true }
serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true }
anyhow = { workspace = true }

[dev-dependencies]
pretty_assertions.workspace = true

[features]
default = ["std"]
std = ["anyhow/std", "serde/std", "serde_json/std"]
5 changes: 5 additions & 0 deletions substrate/frame/revive/rpc/codegen/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Generates the Ethereum JSON-RPC API from the official specification.

- See <https://github.com/ethereum/execution-apis>
- See building instructions to re-generate the openrpc.json <https://github.com/ethereum/execution-apis?tab=readme-ov-file#building>
- Include fixes from <https://github.com/ethereum/execution-apis/pull/552>
Loading

0 comments on commit ae59158

Please sign in to comment.