mirror of
https://github.com/logos-storage/nim-ethers.git
synced 2026-06-06 09:19:54 +00:00
prevent newHeads logs with no "data" field from killing sales state machine
This commit is contained in:
parent
f3d4d1cb82
commit
7cba9bd9be
@ -70,6 +70,9 @@ func `%`*(blockTag: BlockTag): JsonNode =
|
|||||||
# Log
|
# Log
|
||||||
|
|
||||||
func fromJson*(json: JsonNode, name: string, result: var Log) =
|
func fromJson*(json: JsonNode, name: string, result: var Log) =
|
||||||
|
if not (json.hasKey("data") and json.hasKey("topics")):
|
||||||
|
raise newException(ValueError, "'data' and/or 'topics' fields not found")
|
||||||
|
|
||||||
var data: seq[byte]
|
var data: seq[byte]
|
||||||
var topics: seq[Topic]
|
var topics: seq[Topic]
|
||||||
fromJson(json["data"], "data", data)
|
fromJson(json["data"], "data", data)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user