ChainSafe / discv5

A Typescript implementation of the Discv5 protocol
Apache License 2.0
28 stars 15 forks source link

fix: update service.ts to make sure callback is called in sendPing when initiated by the user #264

Closed alainfurter closed 7 months ago

alainfurter commented 12 months ago

fix: If the user calls the function sendPing the promise is never resolved as the call back in case of success is never called. Currently the callback is only called on case of failure (function rpcFailure) leading to a promise rejection. Adding the code in handlePong should resolve this.

F.e. if the user calls sendPing: const pong = await this.discv5.sendPing(enr) never resolve if ping successfully and pong message received

CLAassistant commented 12 months ago

CLA assistant check
All committers have signed the CLA.

wemeetagain commented 7 months ago