Skip to content

Commit 86f3a41

Browse files
lightclientfjl
andauthored
debug, eth: define error when accessing pruned chain data (#636)
Co-authored-by: Felix Lange <[email protected]>
1 parent 575f51b commit 86f3a41

File tree

4 files changed

+45
-0
lines changed

4 files changed

+45
-0
lines changed

src/debug/getters.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
required: true
66
schema:
77
$ref: '#/components/schemas/BlockNumberOrTag'
8+
errors:
9+
- code: 4444
10+
message: Pruned history unavailable
811
result:
912
name: Header RLP
1013
schema:
@@ -24,6 +27,9 @@
2427
required: true
2528
schema:
2629
$ref: '#/components/schemas/BlockNumberOrTag'
30+
errors:
31+
- code: 4444
32+
message: Pruned history unavailable
2733
result:
2834
name: Block RLP
2935
schema:
@@ -43,6 +49,9 @@
4349
required: true
4450
schema:
4551
$ref: '#/components/schemas/hash32'
52+
errors:
53+
- code: 4444
54+
message: Pruned history unavailable
4655
result:
4756
name: EIP-2718 binary-encoded transaction
4857
schema:
@@ -62,6 +71,9 @@
6271
required: true
6372
schema:
6473
$ref: '#/components/schemas/BlockNumberOrTag'
74+
errors:
75+
- code: 4444
76+
message: Pruned history unavailable
6577
result:
6678
name: Receipts
6779
schema:

src/eth/block.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
oneOf:
1717
- $ref: '#/components/schemas/notFound'
1818
- $ref: '#/components/schemas/Block'
19+
errors:
20+
- code: 4444
21+
message: Pruned history unavailable
1922
examples:
2023
- name: eth_getBlockByHash example
2124
params:
@@ -75,6 +78,9 @@
7578
oneOf:
7679
- $ref: '#/components/schemas/notFound'
7780
- $ref: '#/components/schemas/Block'
81+
errors:
82+
- code: 4444
83+
message: Pruned history unavailable
7884
examples:
7985
- name: eth_getBlockByNumber example
8086
params:
@@ -129,6 +135,9 @@
129135
- $ref: '#/components/schemas/notFound'
130136
- title: Transaction count
131137
$ref: '#/components/schemas/uint'
138+
errors:
139+
- code: 4444
140+
message: Pruned history unavailable
132141
examples:
133142
- name: eth_getBlockTransactionCountByHash example
134143
params:
@@ -150,6 +159,9 @@
150159
- $ref: '#/components/schemas/notFound'
151160
- title: Transaction count
152161
$ref: '#/components/schemas/uint'
162+
errors:
163+
- code: 4444
164+
message: Pruned history unavailable
153165
examples:
154166
- name: eth_getBlockTransactionCountByNumber example
155167
params:
@@ -171,6 +183,9 @@
171183
- $ref: '#/components/schemas/notFound'
172184
- title: Uncle count
173185
$ref: '#/components/schemas/uint'
186+
errors:
187+
- code: 4444
188+
message: Pruned history unavailable
174189
examples:
175190
- name: eth_getUncleCountByBlockHash example
176191
params:
@@ -192,6 +207,9 @@
192207
- $ref: '#/components/schemas/notFound'
193208
- title: Uncle count
194209
$ref: '#/components/schemas/uint'
210+
errors:
211+
- code: 4444
212+
message: Pruned history unavailable
195213
examples:
196214
- name: eth_getUncleCountByBlockNumber example
197215
params:
@@ -216,6 +234,9 @@
216234
type: array
217235
items:
218236
$ref: '#/components/schemas/ReceiptInfo'
237+
errors:
238+
- code: 4444
239+
message: Pruned history unavailable
219240
examples:
220241
- name: eth_getBlockReceipts example
221242
params:

src/eth/filter.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,9 @@
155155
schema:
156156
$ref: '#/components/schemas/Filter'
157157
required: true
158+
errors:
159+
- code: 4444
160+
message: Pruned history unavailable
158161
result:
159162
name: Log objects
160163
schema:

src/eth/transaction.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@
5151
oneOf:
5252
- $ref: '#/components/schemas/notFound'
5353
- $ref: '#/components/schemas/TransactionInfo'
54+
errors:
55+
- code: 4444
56+
message: Pruned history unavailable
5457
examples:
5558
- name: eth_getTransactionByBlockHashAndIndex example
5659
params:
@@ -93,6 +96,9 @@
9396
oneOf:
9497
- $ref: '#/components/schemas/notFound'
9598
- $ref: '#/components/schemas/TransactionInfo'
99+
errors:
100+
- code: 4444
101+
message: Pruned history unavailable
96102
examples:
97103
- name: eth_getTransactionByBlockNumberAndIndex example
98104
params:
@@ -131,6 +137,9 @@
131137
oneOf:
132138
- $ref: '#/components/schemas/notFound'
133139
- $ref: '#/components/schemas/ReceiptInfo'
140+
errors:
141+
- code: 4444
142+
message: Pruned history unavailable
134143
examples:
135144
- name: eth_getTransactionReceipt example
136145
params:

0 commit comments

Comments
 (0)