mirror of
https://github.com/status-im/nim-eth.git
synced 2025-02-16 16:06:35 +00:00
Small fixes needed for the latest ETH networking spec
This commit is contained in:
parent
14e99e0711
commit
517adbbbca
@ -347,7 +347,7 @@ proc hasReqId*(msg: Message): bool =
|
|||||||
proc ResponderType(msg: Message): NimNode =
|
proc ResponderType(msg: Message): NimNode =
|
||||||
var resp = if msg.kind == msgRequest: msg.response else: msg
|
var resp = if msg.kind == msgRequest: msg.response else: msg
|
||||||
newTree(nnkBracketExpr,
|
newTree(nnkBracketExpr,
|
||||||
msg.protocol.backend.ResponderType, resp.recName)
|
msg.protocol.backend.ResponderType, resp.strongRecName)
|
||||||
|
|
||||||
proc newMsg(protocol: P2PProtocol, kind: MessageKind, id: int,
|
proc newMsg(protocol: P2PProtocol, kind: MessageKind, id: int,
|
||||||
procDef: NimNode, timeoutParam: NimNode = nil,
|
procDef: NimNode, timeoutParam: NimNode = nil,
|
||||||
@ -814,6 +814,7 @@ proc genTypeSection*(p: P2PProtocol): NimNode =
|
|||||||
# a particular message type:
|
# a particular message type:
|
||||||
template msgId*(T: type `msgStrongRecName`): int = `msgId`
|
template msgId*(T: type `msgStrongRecName`): int = `msgId`
|
||||||
template msgProtocol*(T: type `msgStrongRecName`): type = `protocolName`
|
template msgProtocol*(T: type `msgStrongRecName`): type = `protocolName`
|
||||||
|
template RecType*(T: type `msgStrongRecName`): untyped = `msgRecName`
|
||||||
|
|
||||||
proc genCode*(p: P2PProtocol): NimNode =
|
proc genCode*(p: P2PProtocol): NimNode =
|
||||||
# TODO: try switching to a simpler for msg in p.messages: loop
|
# TODO: try switching to a simpler for msg in p.messages: loop
|
||||||
|
Loading…
x
Reference in New Issue
Block a user