mirror of https://github.com/status-im/nim-eth.git
Expose id and address of talkreq sender (#393)
This commit is contained in:
parent
bfadcfbfaf
commit
c078f85e48
|
@ -140,7 +140,7 @@ type
|
|||
node: Node
|
||||
message: seq[byte]
|
||||
|
||||
TalkProtocolHandler* = proc(p: TalkProtocol, request: seq[byte]): seq[byte]
|
||||
TalkProtocolHandler* = proc(p: TalkProtocol, request: seq[byte], fromId: NodeId, fromUdpAddress: Address): seq[byte]
|
||||
{.gcsafe, raises: [Defect].}
|
||||
|
||||
TalkProtocol* = ref object of RootObj
|
||||
|
@ -318,7 +318,7 @@ proc handleTalkReq(d: Protocol, fromId: NodeId, fromAddr: Address,
|
|||
TalkRespMessage(response: @[])
|
||||
else:
|
||||
TalkRespMessage(response: talkProtocol.protocolHandler(talkProtocol,
|
||||
talkreq.request))
|
||||
talkreq.request, fromId, fromAddr))
|
||||
let (data, _) = encodeMessagePacket(d.rng[], d.codec, fromId, fromAddr,
|
||||
encodeMessage(talkresp, reqId))
|
||||
|
||||
|
|
|
@ -645,7 +645,7 @@ procSuite "Discovery v5 Tests":
|
|||
rng, PrivateKey.random(rng[]), localAddress(20303))
|
||||
talkProtocol = "echo".toBytes()
|
||||
|
||||
proc handler(protocol: TalkProtocol, request: seq[byte]): seq[byte]
|
||||
proc handler(protocol: TalkProtocol, request: seq[byte], fromId: NodeId, fromUdpAddress: Address): seq[byte]
|
||||
{.gcsafe, raises: [Defect].} =
|
||||
request
|
||||
|
||||
|
@ -670,7 +670,7 @@ procSuite "Discovery v5 Tests":
|
|||
rng, PrivateKey.random(rng[]), localAddress(20303))
|
||||
talkProtocol = "echo".toBytes()
|
||||
|
||||
proc handler(protocol: TalkProtocol, request: seq[byte]): seq[byte]
|
||||
proc handler(protocol: TalkProtocol, request: seq[byte], fromId: NodeId, fromUdpAddress: Address): seq[byte]
|
||||
{.gcsafe, raises: [Defect].} =
|
||||
request
|
||||
|
||||
|
|
Loading…
Reference in New Issue