Skip to content

Commit 28c7b73

Browse files
authored
rm vestigial EIP-7873 support (#3290)
* rm vestigial EIP-7873 support * bump nim-eth and nim-web3
1 parent fb38003 commit 28c7b73

File tree

5 files changed

+31
-36
lines changed

5 files changed

+31
-36
lines changed

hive_integration/nodocker/engine/engine_client.nim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ proc forkchoiceUpdated*(client: RpcClient,
8080
of Version.V1: return client.forkchoiceUpdatedV1(update, attr.V1)
8181
of Version.V2: return client.forkchoiceUpdatedV2(update, attr)
8282
of Version.V3: return client.forkchoiceUpdatedV3(update, attr)
83-
of Version.V4: discard
83+
of Version.V4, Version.V5: discard
8484

8585
proc getPayloadV1*(client: RpcClient, payloadId: Bytes8): Result[ExecutionPayloadV1, string] =
8686
wrapTrySimpleRes:
@@ -212,7 +212,7 @@ proc newPayload*(client: RpcClient,
212212
return client.newPayloadV3(payload.basePayload,
213213
payload.versionedHashes,
214214
payload.beaconRoot)
215-
of Version.V4:
215+
of Version.V4, Version.V5: # Osaka doesn't define any new newPayloadV5
216216
return client.newPayloadV4(payload.basePayload,
217217
payload.versionedHashes,
218218
payload.beaconRoot,

tools/t8n/helpers.nim

Lines changed: 26 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ template wrapValueError(body: untyped) =
4646
except ValueError as exc:
4747
r.raiseUnexpectedValue(exc.msg)
4848

49-
proc parseHexOrInt[T](x: string): T {.raises: [ValueError].} =
49+
func parseHexOrInt[T](x: string): T {.raises: [ValueError].} =
5050
when T is UInt256:
5151
if x.startsWith("0x"):
5252
UInt256.fromHex(x)
@@ -258,10 +258,6 @@ proc parseTxJson(txo: TxObject, chainId: ChainId): Result[Transaction, string] =
258258
required(maxFeePerGas)
259259
optional(accessList)
260260
required(authorizationList)
261-
of TxEip7873:
262-
required(chainId)
263-
optional(accessList)
264-
required(initCodes)
265261

266262
# Ignore chainId if txType == TxLegacy
267263
if tx.txType > TxLegacy and tx.chainId != chainId:
@@ -278,7 +274,7 @@ proc parseTxJson(txo: TxObject, chainId: ChainId): Result[Transaction, string] =
278274
required(s, S)
279275
ok(tx)
280276

281-
proc readNestedTx(rlp: var Rlp, chainId: ChainId): Result[Transaction, string] =
277+
func readNestedTx(rlp: var Rlp, chainId: ChainId): Result[Transaction, string] =
282278
try:
283279
let tx = if rlp.isList:
284280
rlp.read(Transaction)
@@ -292,7 +288,7 @@ proc readNestedTx(rlp: var Rlp, chainId: ChainId): Result[Transaction, string] =
292288
except RlpError as exc:
293289
err(exc.msg)
294290

295-
proc parseTxs*(ctx: var TransContext, chainId: ChainId)
291+
func parseTxs*(ctx: var TransContext, chainId: ChainId)
296292
{.raises: [T8NError, RlpError].} =
297293
var numTxs = ctx.txsJson.len
298294
var rlp: Rlp
@@ -311,7 +307,7 @@ proc parseTxs*(ctx: var TransContext, chainId: ChainId)
311307
for item in rlp:
312308
ctx.txList.add rlp.readNestedTx(chainId)
313309

314-
proc filterGoodTransactions*(ctx: TransContext): seq[Transaction] =
310+
func filterGoodTransactions*(ctx: TransContext): seq[Transaction] =
315311
for txRes in ctx.txList:
316312
if txRes.isOk:
317313
result.add txRes.get
@@ -336,7 +332,7 @@ proc parseEnv*(ctx: var TransContext, envFile: string) {.raises: [T8NError].} =
336332
wrapException:
337333
ctx.env = T8Conv.loadFile(envFile, EnvStruct)
338334

339-
proc parseTxsRlp*(ctx: var TransContext, hexData: string) {.raises: [ValueError].} =
335+
func parseTxsRlp*(ctx: var TransContext, hexData: string) {.raises: [ValueError].} =
340336
ctx.txsRlp = hexToSeqByte(hexData)
341337

342338
proc parseInputFromStdin*(ctx: var TransContext) {.raises: [T8NError].} =
@@ -354,42 +350,42 @@ template stripLeadingZeros(value: string): string =
354350
cidx.inc
355351
value[cidx .. ^1]
356352

357-
proc `@@`*[K, V](x: Table[K, V]): JsonNode
358-
proc `@@`*[T](x: seq[T]): JsonNode
353+
func `@@`*[K, V](x: Table[K, V]): JsonNode
354+
func `@@`*[T](x: seq[T]): JsonNode
359355

360-
proc to0xHex(x: UInt256): string =
356+
func to0xHex(x: UInt256): string =
361357
"0x" & x.toHex
362358

363-
proc `@@`(x: uint64 | int64 | int): JsonNode =
359+
func `@@`(x: uint64 | int64 | int): JsonNode =
364360
let hex = x.toHex.stripLeadingZeros
365361
%("0x" & hex.toLowerAscii)
366362

367-
proc `@@`(x: UInt256): JsonNode =
363+
func `@@`(x: UInt256): JsonNode =
368364
%("0x" & x.toHex)
369365

370-
proc `@@`(x: Hash32): JsonNode =
366+
func `@@`(x: Hash32): JsonNode =
371367
%("0x" & x.data.toHex)
372368

373-
proc `@@`*(x: seq[byte]): JsonNode =
369+
func `@@`*(x: seq[byte]): JsonNode =
374370
%("0x" & x.toHex)
375371

376-
proc `@@`(x: bool): JsonNode =
372+
func `@@`(x: bool): JsonNode =
377373
%(if x: "0x1" else: "0x0")
378374

379-
proc `@@`(x: openArray[byte]): JsonNode =
375+
func `@@`(x: openArray[byte]): JsonNode =
380376
%("0x" & x.toHex)
381377

382-
proc `@@`(x: FixedBytes|Hash32|Address): JsonNode =
378+
func `@@`(x: FixedBytes|Hash32|Address): JsonNode =
383379
@@(x.data)
384380

385-
proc toJson(x: Table[UInt256, UInt256]): JsonNode =
381+
func toJson(x: Table[UInt256, UInt256]): JsonNode =
386382
# special case, we need to convert UInt256 into full 32 bytes
387383
# and not shorter
388384
result = newJObject()
389385
for k, v in x:
390386
result["0x" & k.dumpHex] = %("0x" & v.dumpHex)
391387

392-
proc `@@`(acc: GenesisAccount): JsonNode =
388+
func `@@`(acc: GenesisAccount): JsonNode =
393389
result = newJObject()
394390
if acc.code.len > 0:
395391
result["code"] = @@(acc.code)
@@ -399,22 +395,22 @@ proc `@@`(acc: GenesisAccount): JsonNode =
399395
if acc.storage.len > 0:
400396
result["storage"] = toJson(acc.storage)
401397

402-
proc `@@`[K, V](x: Table[K, V]): JsonNode =
398+
func `@@`[K, V](x: Table[K, V]): JsonNode =
403399
result = newJObject()
404400
for k, v in x:
405401
result[k.to0xHex] = @@(v)
406402

407-
proc `@@`(x: Bloom): JsonNode =
403+
func `@@`(x: Bloom): JsonNode =
408404
%("0x" & toHex(x))
409405

410-
proc `@@`(x: Log): JsonNode =
406+
func `@@`(x: Log): JsonNode =
411407
%{
412408
"address": @@(x.address),
413409
"topics" : @@(x.topics),
414410
"data" : @@(x.data)
415411
}
416412

417-
proc `@@`(x: TxReceipt): JsonNode =
413+
func `@@`(x: TxReceipt): JsonNode =
418414
result = %{
419415
"root" : if x.root == default(Hash32): %("0x") else: @@(x.root),
420416
"status" : @@(x.status),
@@ -430,29 +426,29 @@ proc `@@`(x: TxReceipt): JsonNode =
430426
if x.txType > TxLegacy:
431427
result["type"] = %("0x" & toHex(x.txType.int, 1))
432428

433-
proc `@@`(x: RejectedTx): JsonNode =
429+
func `@@`(x: RejectedTx): JsonNode =
434430
%{
435431
"index": %(x.index),
436432
"error": %(x.error)
437433
}
438434

439-
proc `@@`[T](x: seq[T]): JsonNode =
435+
func `@@`[T](x: seq[T]): JsonNode =
440436
result = newJArray()
441437
for c in x:
442438
result.add @@(c)
443439

444-
proc `@@`[N, T](x: array[N, T]): JsonNode =
440+
func `@@`[N, T](x: array[N, T]): JsonNode =
445441
result = newJArray()
446442
for c in x:
447443
result.add @@(c)
448444

449-
proc `@@`[T](x: Opt[T]): JsonNode =
445+
func `@@`[T](x: Opt[T]): JsonNode =
450446
if x.isNone:
451447
newJNull()
452448
else:
453449
@@(x.get())
454450

455-
proc `@@`*(x: ExecutionResult): JsonNode =
451+
func `@@`*(x: ExecutionResult): JsonNode =
456452
result = %{
457453
"stateRoot" : @@(x.stateRoot),
458454
"txRoot" : @@(x.txRoot),

tools/t8n/types.nim

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ type
7474
maxFeePerBlobGas* : Opt[UInt256]
7575
blobVersionedHashes* : Opt[seq[Hash32]]
7676
authorizationList* : Opt[seq[Authorization]]
77-
initCodes* : Opt[seq[seq[byte]]]
7877

7978
TxList* = seq[Result[Transaction, string]]
8079

@@ -130,5 +129,5 @@ const
130129
ErrorIO* = 11.T8NExitCode
131130
ErrorRlp* = 12.T8NExitCode
132131

133-
proc newError*(code: T8NExitCode, msg: string): ref T8NError =
132+
func newError*(code: T8NExitCode, msg: string): ref T8NError =
134133
(ref T8NError)(exitCode: code, msg: msg)

0 commit comments

Comments
 (0)