ethjs / ethjs-rpc

A super simple module for making low level queries to the Ethereum RPC layer.
MIT License
14 stars 11 forks source link

only return a promise if no callback provided #4

Closed kumavis closed 6 years ago

kumavis commented 6 years ago

only return a promise if no callback provided - otherwise instrument the promise so it doesnt throw unhandled rejections

this is important because if you dont use the promise (as it is not used in ethjs-query) it will cause an "unhandled promise rejection" if it errors

this PR avoids this problem by instrumenting the internal promise when a callback is provided.

Note: return undefined; is a result of your linters strange fetishes

kumavis commented 6 years ago

While this is technically a bug fix, I reccomend releasing it under a major version bump

coveralls commented 6 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling a7a7804c70551827de5ed15d42f9550c4aadba1f on kumavis:master into cb04ea6a1b930b90c7e27e88d00bfbfc3ed76c7e on ethjs:master.