mirror of https://github.com/status-im/nim-abc.git
Pretty printing of hashes
This commit is contained in:
parent
0a604491ee
commit
7db55248fa
|
@ -15,3 +15,10 @@ func toBytes*(hash: Hash): array[32, byte] =
|
||||||
|
|
||||||
func hash*(hash: Hash): hashes.Hash =
|
func hash*(hash: Hash): hashes.Hash =
|
||||||
hashes.hash(hash.toBytes)
|
hashes.hash(hash.toBytes)
|
||||||
|
|
||||||
|
func `$`*(hash: Hash): string =
|
||||||
|
case hash.kind
|
||||||
|
of Tx:
|
||||||
|
"Tx(" & $hash.hash & ")"
|
||||||
|
of Ack:
|
||||||
|
"Ack(" & $hash.hash & ")"
|
||||||
|
|
Loading…
Reference in New Issue