mirror of
https://github.com/logos-storage/nim-ethers.git
synced 2026-01-08 16:43:09 +00:00
adds number getter for BlockTags with number
This commit is contained in:
parent
037bef0256
commit
c7c57113ce
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user