@@ -46,7 +46,7 @@ template wrapValueError(body: untyped) =
46
46
except ValueError as exc:
47
47
r.raiseUnexpectedValue(exc.msg)
48
48
49
- proc parseHexOrInt[T](x: string ): T {.raises: [ValueError].} =
49
+ func parseHexOrInt[T](x: string ): T {.raises: [ValueError].} =
50
50
when T is UInt256:
51
51
if x.startsWith("0x"):
52
52
UInt256.fromHex(x)
@@ -258,10 +258,6 @@ proc parseTxJson(txo: TxObject, chainId: ChainId): Result[Transaction, string] =
258
258
required(maxFeePerGas)
259
259
optional(accessList)
260
260
required(authorizationList)
261
- of TxEip7873:
262
- required(chainId)
263
- optional(accessList)
264
- required(initCodes)
265
261
266
262
# Ignore chainId if txType == TxLegacy
267
263
if tx.txType > TxLegacy and tx.chainId != chainId:
@@ -278,7 +274,7 @@ proc parseTxJson(txo: TxObject, chainId: ChainId): Result[Transaction, string] =
278
274
required(s, S)
279
275
ok(tx)
280
276
281
- proc readNestedTx(rlp: var Rlp, chainId: ChainId): Result[Transaction, string ] =
277
+ func readNestedTx(rlp: var Rlp, chainId: ChainId): Result[Transaction, string ] =
282
278
try :
283
279
let tx = if rlp.isList:
284
280
rlp.read(Transaction)
@@ -292,7 +288,7 @@ proc readNestedTx(rlp: var Rlp, chainId: ChainId): Result[Transaction, string] =
292
288
except RlpError as exc:
293
289
err(exc.msg)
294
290
295
- proc parseTxs* (ctx: var TransContext, chainId: ChainId)
291
+ func parseTxs* (ctx: var TransContext, chainId: ChainId)
296
292
{.raises: [T8NError, RlpError].} =
297
293
var numTxs = ctx.txsJson.len
298
294
var rlp: Rlp
@@ -311,7 +307,7 @@ proc parseTxs*(ctx: var TransContext, chainId: ChainId)
311
307
for item in rlp:
312
308
ctx.txList.add rlp.readNestedTx(chainId)
313
309
314
- proc filterGoodTransactions* (ctx: TransContext): seq [Transaction] =
310
+ func filterGoodTransactions* (ctx: TransContext): seq [Transaction] =
315
311
for txRes in ctx.txList:
316
312
if txRes.isOk:
317
313
result .add txRes.get
@@ -336,7 +332,7 @@ proc parseEnv*(ctx: var TransContext, envFile: string) {.raises: [T8NError].} =
336
332
wrapException:
337
333
ctx.env = T8Conv.loadFile(envFile, EnvStruct)
338
334
339
- proc parseTxsRlp* (ctx: var TransContext, hexData: string ) {.raises: [ValueError].} =
335
+ func parseTxsRlp* (ctx: var TransContext, hexData: string ) {.raises: [ValueError].} =
340
336
ctx.txsRlp = hexToSeqByte(hexData)
341
337
342
338
proc parseInputFromStdin* (ctx: var TransContext) {.raises: [T8NError].} =
@@ -354,42 +350,42 @@ template stripLeadingZeros(value: string): string =
354
350
cidx.inc
355
351
value[cidx .. ^ 1 ]
356
352
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
359
355
360
- proc to0xHex(x: UInt256): string =
356
+ func to0xHex(x: UInt256): string =
361
357
" 0x" & x.toHex
362
358
363
- proc `@@` (x: uint64 | int64 | int ): JsonNode =
359
+ func `@@` (x: uint64 | int64 | int ): JsonNode =
364
360
let hex = x.toHex.stripLeadingZeros
365
361
% (" 0x" & hex.toLowerAscii)
366
362
367
- proc `@@` (x: UInt256): JsonNode =
363
+ func `@@` (x: UInt256): JsonNode =
368
364
% (" 0x" & x.toHex)
369
365
370
- proc `@@` (x: Hash32): JsonNode =
366
+ func `@@` (x: Hash32): JsonNode =
371
367
% (" 0x" & x.data.toHex)
372
368
373
- proc `@@` * (x: seq [byte ]): JsonNode =
369
+ func `@@` * (x: seq [byte ]): JsonNode =
374
370
% (" 0x" & x.toHex)
375
371
376
- proc `@@` (x: bool ): JsonNode =
372
+ func `@@` (x: bool ): JsonNode =
377
373
% (if x: " 0x1" else : " 0x0" )
378
374
379
- proc `@@` (x: openArray [byte ]): JsonNode =
375
+ func `@@` (x: openArray [byte ]): JsonNode =
380
376
% (" 0x" & x.toHex)
381
377
382
- proc `@@` (x: FixedBytes| Hash32| Address): JsonNode =
378
+ func `@@` (x: FixedBytes| Hash32| Address): JsonNode =
383
379
@@ (x.data)
384
380
385
- proc toJson(x: Table[UInt256, UInt256]): JsonNode =
381
+ func toJson(x: Table[UInt256, UInt256]): JsonNode =
386
382
# special case, we need to convert UInt256 into full 32 bytes
387
383
# and not shorter
388
384
result = newJObject()
389
385
for k, v in x:
390
386
result [" 0x" & k.dumpHex] = % (" 0x" & v.dumpHex)
391
387
392
- proc `@@` (acc: GenesisAccount): JsonNode =
388
+ func `@@` (acc: GenesisAccount): JsonNode =
393
389
result = newJObject()
394
390
if acc.code.len > 0 :
395
391
result [" code" ] = @@ (acc.code)
@@ -399,22 +395,22 @@ proc `@@`(acc: GenesisAccount): JsonNode =
399
395
if acc.storage.len > 0 :
400
396
result [" storage" ] = toJson(acc.storage)
401
397
402
- proc `@@` [K, V](x: Table[K, V]) : JsonNode =
398
+ func `@@` [K, V](x: Table[K, V]) : JsonNode =
403
399
result = newJObject()
404
400
for k, v in x:
405
401
result [k.to0xHex] = @@ (v)
406
402
407
- proc `@@` (x: Bloom): JsonNode =
403
+ func `@@` (x: Bloom): JsonNode =
408
404
% (" 0x" & toHex(x))
409
405
410
- proc `@@` (x: Log): JsonNode =
406
+ func `@@` (x: Log): JsonNode =
411
407
% {
412
408
" address" : @@ (x.address),
413
409
" topics" : @@ (x.topics),
414
410
" data" : @@ (x.data)
415
411
}
416
412
417
- proc `@@` (x: TxReceipt): JsonNode =
413
+ func `@@` (x: TxReceipt): JsonNode =
418
414
result = % {
419
415
" root" : if x.root == default(Hash32): % (" 0x" ) else : @@ (x.root),
420
416
" status" : @@ (x.status),
@@ -430,29 +426,29 @@ proc `@@`(x: TxReceipt): JsonNode =
430
426
if x.txType > TxLegacy:
431
427
result [" type" ] = % (" 0x" & toHex(x.txType.int , 1 ))
432
428
433
- proc `@@` (x: RejectedTx): JsonNode =
429
+ func `@@` (x: RejectedTx): JsonNode =
434
430
% {
435
431
" index" : % (x.index),
436
432
" error" : % (x.error)
437
433
}
438
434
439
- proc `@@` [T](x: seq [T]) : JsonNode =
435
+ func `@@` [T](x: seq [T]) : JsonNode =
440
436
result = newJArray()
441
437
for c in x:
442
438
result .add @@ (c)
443
439
444
- proc `@@` [N, T](x: array [N, T]) : JsonNode =
440
+ func `@@` [N, T](x: array [N, T]) : JsonNode =
445
441
result = newJArray()
446
442
for c in x:
447
443
result .add @@ (c)
448
444
449
- proc `@@` [T](x: Opt[T]) : JsonNode =
445
+ func `@@` [T](x: Opt[T]) : JsonNode =
450
446
if x.isNone:
451
447
newJNull()
452
448
else :
453
449
@@ (x.get())
454
450
455
- proc `@@` * (x: ExecutionResult): JsonNode =
451
+ func `@@` * (x: ExecutionResult): JsonNode =
456
452
result = % {
457
453
" stateRoot" : @@ (x.stateRoot),
458
454
" txRoot" : @@ (x.txRoot),
0 commit comments