mirror of
https://github.com/logos-storage/nim-ethers.git
synced 2026-01-10 01:23:05 +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
|
||||
|
||||
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 topics: seq[Topic]
|
||||
fromJson(json["data"], "data", data)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user