Add fork to string proc

This commit is contained in:
coffeepots 2018-09-11 14:53:15 +01:00
parent d465fcd038
commit 2b6342764c
1 changed files with 12 additions and 0 deletions

View File

@ -48,3 +48,15 @@ proc toFork*(blockNumber: UInt256): Fork =
elif blockNumber < forkBlocks[FkByzantium]: FkSpurious
else:
FkByzantium # Update for constantinople when announced
proc `$`*(fork: Fork): string =
case fork
of FkFrontier: result = "Frontier"
of FkThawing: result = "Thawing"
of FkHomestead: result = "Homestead"
of FkDao: result = "Dao"
of FkTangerine: result = "Tangerine"
of FkSpurious: result = "Spurious"
of FkByzantium: result = "Byzantium"
else: result = "UNKNOWN FORK"