Forks: Use capitalized names again for presentation (logging etc.)

Fork names were originally capitalized, and were made lower case by @narimiran
in commit 36a7519 to satisfy `parseEnum` in some tests.  Restore the
capitalization and make the tests work with it.

Signed-off-by: Jamie Lokier <jamie@shareable.org>
This commit is contained in:
Jamie Lokier 2021-06-01 11:10:20 +01:00
parent 05bc174bef
commit 84269ddccf
No known key found for this signature in database
GPG Key ID: CBC25C68435C30A2
2 changed files with 13 additions and 11 deletions

View File

@ -8,12 +8,12 @@
type
Fork* = enum
FkFrontier = "frontier"
FkHomestead = "homestead"
FkTangerine = "tangerine whistle"
FkSpurious = "spurious dragon"
FkByzantium = "byzantium"
FkConstantinople = "constantinople"
FkPetersburg = "petersburg"
FkIstanbul = "istanbul"
FkBerlin = "berlin"
FkFrontier = "Frontier"
FkHomestead = "Homestead"
FkTangerine = "Tangerine Whistle"
FkSpurious = "Spurious Dragon"
FkByzantium = "Byzantium"
FkConstantinople = "Constantinople"
FkPetersburg = "Petersburg"
FkIstanbul = "Istanbul"
FkBerlin = "Berlin"

View File

@ -1,5 +1,5 @@
import
macrocache, strutils, unittest2,
macrocache, strutils, sequtils, unittest2,
stew/byteutils, chronicles, eth/common,
stew/shims/macros
@ -167,7 +167,9 @@ proc parseCode(codes: NimNode): seq[byte] =
proc parseFork(fork: NimNode): Fork =
fork[0].expectKind({nnkIdent, nnkStrLit})
parseEnum[Fork](strip(fork[0].strVal))
# Normalise whitespace and capitalize each word because `parseEnum` matches
# enum string values not symbols, and the strings are capitalized in `Fork`.
parseEnum[Fork](fork[0].strVal.splitWhitespace().map(capitalizeAscii).join(" "))
proc parseGasUsed(gas: NimNode): GasInt =
gas[0].expectKind(nnkIntLit)