adds number getter for BlockTags with number

This commit is contained in:
Marcin Czenko 2024-12-10 15:57:08 +01:00
parent 037bef0256
commit c7c57113ce

View File

@ -1,4 +1,5 @@
import pkg/stint
import pkg/questionable
{.push raises:[].}
@ -41,3 +42,10 @@ func `==`*(a, b: BlockTag): bool =
a.stringValue == b.stringValue
of numberBlockTag:
a.numberValue == b.numberValue
func number*(blockTag: BlockTag): ?UInt256 =
case blockTag.kind
of stringBlockTag:
UInt256.none
of numberBlockTag:
blockTag.numberValue.some