mirror of
https://github.com/status-im/nimbus-eth1.git
synced 2025-02-02 23:35:31 +00:00
Adjust discv5_updateNodeInfo JSON-RPC to specify key and value (#1569)
This commit is contained in:
parent
cdfc99e4f7
commit
9097548a10
@ -30,10 +30,9 @@ proc installDiscoveryApiHandlers*(rpcServer: RpcServer|RpcProxy,
|
|||||||
return d.routingTable.getNodeInfo()
|
return d.routingTable.getNodeInfo()
|
||||||
|
|
||||||
rpcServer.rpc("discv5_updateNodeInfo") do(
|
rpcServer.rpc("discv5_updateNodeInfo") do(
|
||||||
kvPairs: seq[(string, string)]) -> NodeInfo:
|
kvPairs: seq[tuple[key: string, value: string]]) -> NodeInfo:
|
||||||
# TODO: Not according to spec, as spec parameters are weird.
|
# TODO: Not according to spec, as spec only allows socket address.
|
||||||
# It is currently as in
|
# portal-specs PR has been created with suggested change as is here.
|
||||||
# https://ddht.readthedocs.io/en/latest/jsonrpc.html#discv5-updatenodeinfo
|
|
||||||
let enrFields = kvPairs.map(
|
let enrFields = kvPairs.map(
|
||||||
proc(n: (string, string)): (string, seq[byte]) {.raises: [ValueError].} =
|
proc(n: (string, string)): (string, seq[byte]) {.raises: [ValueError].} =
|
||||||
(n[0], hexToSeqByte(n[1]))
|
(n[0], hexToSeqByte(n[1]))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user