Skip to content

Commit ff43500

Browse files
Add examples for engine methods (ethereum#465)
* Add examples for engine methods * Address feedback * minor edit * add additional example parameters * add txn examples
1 parent c408941 commit ff43500

File tree

5 files changed

+435
-1
lines changed

5 files changed

+435
-1
lines changed

spellcheck.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,10 @@ matrix:
3434
wordlists:
3535
- wordlist.txt
3636
encoding: utf-8
37-
pipeline: null
37+
pipeline:
38+
- pyspelling.filters.context:
39+
context_visible_first: true
40+
delimiters:
41+
- open: ''
42+
content: 0x[a-fA-F0-9]+
43+
close: ''

src/engine/openrpc/methods/capabilities.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,27 @@
1616
type: array
1717
items:
1818
type: string
19+
examples:
20+
- name: engine_exchangeCapabilities example
21+
params:
22+
- name: Consensus client methods
23+
value:
24+
- 'engine_exchangeTransitionConfigurationV1'
25+
- 'engine_forkchoiceUpdatedV1'
26+
- 'engine_getPayloadBodiesByHashV1'
27+
- 'engine_getPayloadBodiesByRangeV1'
28+
- 'engine_getPayloadV1'
29+
- 'engine_newPayloadV1'
30+
result:
31+
name: Execution client methods
32+
value:
33+
- 'engine_getPayloadV1'
34+
- 'engine_getPayloadV2'
35+
- 'engine_executePayloadV1'
36+
- 'engine_newPayloadV1'
37+
- 'engine_newPayloadV2'
38+
- 'engine_forkchoiceUpdatedV1'
39+
- 'engine_forkchoiceUpdatedV2'
40+
- 'engine_exchangeTransitionConfigurationV1'
41+
- 'engine_getPayloadBodiesByHashV1'
42+
- 'engine_getPayloadBodiesByRangeV1'

src/engine/openrpc/methods/forkchoice.yaml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,27 @@
2121
message: Invalid forkchoice state
2222
- code: -38003
2323
message: Invalid payload attributes
24+
examples:
25+
- name: engine_forkchoiceUpdatedV1 example
26+
params:
27+
- name: Forkchoice state
28+
value:
29+
headBlockHash: '0x3559e851470f6e7bbed1db474980683e8c315bfce99b2a6ef47c057c04de7858'
30+
safeBlockHash: '0x3559e851470f6e7bbed1db474980683e8c315bfce99b2a6ef47c057c04de7858'
31+
finalizedBlockHash: '0x3b8fb240d288781d4aac94d3fd16809ee413bc99294a085798a589dae51ddd4a'
32+
- name: Payload attributes
33+
value:
34+
timestamp: '0x5'
35+
prevRandao: '0x0000000000000000000000000000000000000000000000000000000000000000'
36+
suggestedFeeRecipient: '0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b'
37+
result:
38+
name: Response object
39+
value:
40+
payloadStatus:
41+
status: VALID
42+
latestValidHash: '0x3559e851470f6e7bbed1db474980683e8c315bfce99b2a6ef47c057c04de7858'
43+
validationError: null
44+
payloadId: '0x0000000021f32cc1'
2445
- name: engine_forkchoiceUpdatedV2
2546
summary: Updates the forkchoice state
2647
externalDocs:
@@ -44,6 +65,36 @@
4465
message: Invalid forkchoice state
4566
- code: -38003
4667
message: Invalid payload attributes
68+
examples:
69+
- name: engine_forkchoiceUpdatedV2 example
70+
params:
71+
- name: Forkchoice state
72+
value:
73+
headBlockHash: '0x3559e851470f6e7bbed1db474980683e8c315bfce99b2a6ef47c057c04de7858'
74+
safeBlockHash: '0x3559e851470f6e7bbed1db474980683e8c315bfce99b2a6ef47c057c04de7858'
75+
finalizedBlockHash: '0x3b8fb240d288781d4aac94d3fd16809ee413bc99294a085798a589dae51ddd4a'
76+
- name: Payload attributes
77+
value:
78+
timestamp: '0x64e7785b'
79+
prevRandao: '0xc130d5e63c61c935f6089e61140ca9136172677cf6aa5800dcc1cf0a02152a14'
80+
suggestedFeeRecipient: '0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b'
81+
withdrawals:
82+
- index: '0xf0'
83+
validatorIndex: '0xf0'
84+
address: '0x00000000000000000000000000000000000010f0'
85+
amount: '0x1'
86+
- index: '0xf1'
87+
validatorIndex: '0xf1'
88+
address: '0x00000000000000000000000000000000000010f1'
89+
amount: '0x1'
90+
result:
91+
name: Response object
92+
value:
93+
payloadStatus:
94+
status: VALID
95+
latestValidHash: '0x3559e851470f6e7bbed1db474980683e8c315bfce99b2a6ef47c057c04de7858'
96+
validationError: null
97+
payloadId: '0x0000000021f32cc1'
4798
- name: engine_forkchoiceUpdatedV3
4899
summary: Updates the forkchoice state
49100
externalDocs:
@@ -71,3 +122,34 @@
71122
message: Invalid params
72123
- code: -38005
73124
message: Unsupported fork
125+
examples:
126+
- name: engine_forkchoiceUpdatedV3 example
127+
params:
128+
- name: Forkchoice state
129+
value:
130+
headBlockHash: '0x3559e851470f6e7bbed1db474980683e8c315bfce99b2a6ef47c057c04de7858'
131+
safeBlockHash: '0x3559e851470f6e7bbed1db474980683e8c315bfce99b2a6ef47c057c04de7858'
132+
finalizedBlockHash: '0x3b8fb240d288781d4aac94d3fd16809ee413bc99294a085798a589dae51ddd4a'
133+
- name: Payload attributes
134+
value:
135+
timestamp: '0x64e7785b'
136+
prevRandao: '0xc130d5e63c61c935f6089e61140ca9136172677cf6aa5800dcc1cf0a02152a14'
137+
suggestedFeeRecipient: '0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b'
138+
withdrawals:
139+
- index: '0xf0'
140+
validatorIndex: '0xf0'
141+
address: '0x00000000000000000000000000000000000010f0'
142+
amount: '0x1'
143+
- index: '0xf1'
144+
validatorIndex: '0xf1'
145+
address: '0x00000000000000000000000000000000000010f1'
146+
amount: '0x1'
147+
parentBeaconBlockRoot: '0x11f780a954bcba8889998e4e61deaae6388dd2391e9c810bd9c94962cc1eadc1'
148+
result:
149+
name: Response object
150+
value:
151+
payloadStatus:
152+
status: VALID
153+
latestValidHash: '0x3559e851470f6e7bbed1db474980683e8c315bfce99b2a6ef47c057c04de7858'
154+
validationError: null
155+
payloadId: '0x0000000021f32cc1'

0 commit comments

Comments
 (0)