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":
|
if result.kind != nnkBracketExpr or $result[0] != "ref":
|
||||||
macros.error($result & " must be a ref type")
|
macros.error($result & " must be a ref type")
|
||||||
|
|
||||||
proc newFuture[T](location: var Future[T]) =
|
proc initFuture[T](loc: var Future[T]) =
|
||||||
location = newFuture[T]()
|
loc = newFuture[T]()
|
||||||
|
|
||||||
|
|
|
@ -500,7 +500,7 @@ proc nextMsg*(peer: Peer, MsgType: type): Future[MsgType] =
|
||||||
if not f.isNil:
|
if not f.isNil:
|
||||||
return Future[MsgType](f)
|
return Future[MsgType](f)
|
||||||
|
|
||||||
newFuture result
|
initFuture result
|
||||||
peer.awaitedMessages[wantedId] = result
|
peer.awaitedMessages[wantedId] = result
|
||||||
|
|
||||||
# Known fatal errors are handled inside dispatchMessages.
|
# Known fatal errors are handled inside dispatchMessages.
|
||||||
|
@ -776,12 +776,12 @@ macro p2pProtocolImpl(name: static[string],
|
||||||
responseMsgId)
|
responseMsgId)
|
||||||
if hasReqIds:
|
if hasReqIds:
|
||||||
appendParams.add quote do:
|
appendParams.add quote do:
|
||||||
newFuture `resultIdent`
|
initFuture `resultIdent`
|
||||||
let `reqId` = `registerRequestCall`
|
let `reqId` = `registerRequestCall`
|
||||||
paramsToWrite.add reqId
|
paramsToWrite.add reqId
|
||||||
else:
|
else:
|
||||||
appendParams.add quote do:
|
appendParams.add quote do:
|
||||||
newFuture `resultIdent`
|
initFuture `resultIdent`
|
||||||
discard `registerRequestCall`
|
discard `registerRequestCall`
|
||||||
|
|
||||||
of rlpxResponse:
|
of rlpxResponse:
|
||||||
|
|
Loading…
Reference in New Issue