mirror of https://github.com/status-im/nim-eth.git
Workaround compilation error cause by chronos newFuture changes
This commit is contained in:
parent
bc23b68c95
commit
ca8519ef61
|
@ -61,6 +61,6 @@ proc verifyStateType(t: NimNode): NimNode =
|
|||
if result.kind != nnkBracketExpr or $result[0] != "ref":
|
||||
macros.error($result & " must be a ref type")
|
||||
|
||||
proc newFuture[T](location: var Future[T]) =
|
||||
location = newFuture[T]()
|
||||
proc initFuture[T](loc: var Future[T]) =
|
||||
loc = newFuture[T]()
|
||||
|
||||
|
|
|
@ -500,7 +500,7 @@ proc nextMsg*(peer: Peer, MsgType: type): Future[MsgType] =
|
|||
if not f.isNil:
|
||||
return Future[MsgType](f)
|
||||
|
||||
newFuture result
|
||||
initFuture result
|
||||
peer.awaitedMessages[wantedId] = result
|
||||
|
||||
# Known fatal errors are handled inside dispatchMessages.
|
||||
|
@ -776,12 +776,12 @@ macro p2pProtocolImpl(name: static[string],
|
|||
responseMsgId)
|
||||
if hasReqIds:
|
||||
appendParams.add quote do:
|
||||
newFuture `resultIdent`
|
||||
initFuture `resultIdent`
|
||||
let `reqId` = `registerRequestCall`
|
||||
paramsToWrite.add reqId
|
||||
else:
|
||||
appendParams.add quote do:
|
||||
newFuture `resultIdent`
|
||||
initFuture `resultIdent`
|
||||
discard `registerRequestCall`
|
||||
|
||||
of rlpxResponse:
|
||||
|
|
Loading…
Reference in New Issue