Merge pull request #528 from narimiran/parse-enum-2
write `Fork` enum in a "modern way"
This commit is contained in:
commit
676ce3aedb
|
@ -9,22 +9,11 @@ import stint, eth/common/eth_types
|
||||||
|
|
||||||
type
|
type
|
||||||
Fork* = enum
|
Fork* = enum
|
||||||
FkFrontier,
|
FkFrontier = "frontier"
|
||||||
FkHomestead,
|
FkHomestead = "homestead"
|
||||||
FkTangerine,
|
FkTangerine = "tangerine whistle"
|
||||||
FkSpurious,
|
FkSpurious = "spurious dragon"
|
||||||
FkByzantium,
|
FkByzantium = "byzantium"
|
||||||
FkConstantinople,
|
FkConstantinople = "constantinople"
|
||||||
FkPetersburg,
|
FkPetersburg = "petersburg"
|
||||||
FkIstanbul
|
FkIstanbul = "istanbul"
|
||||||
|
|
||||||
proc `$`*(fork: Fork): string =
|
|
||||||
case fork
|
|
||||||
of FkFrontier: result = "Frontier"
|
|
||||||
of FkHomestead: result = "Homestead"
|
|
||||||
of FkTangerine: result = "Tangerine Whistle"
|
|
||||||
of FkSpurious: result = "Spurious Dragon"
|
|
||||||
of FkByzantium: result = "Byzantium"
|
|
||||||
of FkConstantinople: result = "Constantinople"
|
|
||||||
of FkPetersburg: result = "Petersburg"
|
|
||||||
of FkIstanbul: result = "Istanbul"
|
|
||||||
|
|
Loading…
Reference in New Issue