Bump nim-eth: Fix improper yield usage (#2036)

This commit is contained in:
andri lim 2024-02-19 16:33:55 +07:00 committed by GitHub
parent 795d0d779e
commit 2a1386e46a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 6 deletions

View File

@ -167,16 +167,19 @@ macro outgoingRequestDecorator(n: untyped): untyped =
trackOutgoingRequest(peer.networkState(les),
peer.state(les),
perProtocolMsgId, reqId, `costQuantity`)
# echo result.repr
#echo "outgoingRequestDecorator: ", result.repr
macro incomingResponseDecorator(n: untyped): untyped =
result = n
let trackingCall = quote do:
trackIncomingResponse(peer.state(les), reqId, msg.bufValue)
try:
trackIncomingResponse(peer.state(les), reqId, msg.bufValue)
except KeyError as exc:
raise newException(EthP2PError, exc.msg)
result.body.insert(n.body.len - 1, trackingCall)
# echo result.repr
#echo "incomingResponseDecorator: ", result.repr
macro incomingRequestDecorator(n: untyped): untyped =
result = n
@ -195,8 +198,9 @@ macro incomingRequestDecorator(n: untyped): untyped =
perProtocolMsgId,
requestCostQuantity): return
result.body.insert(1, getAst(acceptStep(costQuantity, maxQuantity)))
# echo result.repr
let zero = result.body[0][0]
zero.insert(1, getAst(acceptStep(costQuantity, maxQuantity)))
#echo "incomingRequestDecorator: ", result.repr
template updateBV: BufValueInt =
bufValueAfterRequest(lesNetwork, lesPeer,

2
vendor/nim-eth vendored

@ -1 +1 @@
Subproject commit efe610e27f09435b0898b33e9357bc52fe04f52c
Subproject commit d8209f623f837d14c43a9e3fd464b0e199c5d180