status-lib/status/signals/discovery_summary.nim

13 lines
372 B
Nim
Raw Normal View History

2021-09-08 18:05:39 +00:00
import json
import base
type DiscoverySummarySignal* = ref object of Signal
enodes*: seq[string]
proc fromEvent*(jsonSignal: JsonNode): Signal =
var signal:DiscoverySummarySignal = DiscoverySummarySignal()
if jsonSignal["event"].kind != JNull:
for discoveryItem in jsonSignal["event"]:
signal.enodes.add(discoveryItem["enode"].getStr)
result = signal