libp2p / js-peer-id

peer-id implementation in JavaScript. Deprecated; use https://github.com/libp2p/js-libp2p-peer-id instead.
https://github.com/libp2p/js-libp2p-peer-id
MIT License
81 stars 44 forks source link

Catch error when unmarshaling instead of crashing #72

Closed mkg20001 closed 6 years ago

mkg20001 commented 6 years ago

Releated #71

mkg20001 commented 6 years ago

Currently more focused on libp2p-websocket-star. Will add the fix when I've released the new version (0.6.0)

mkg20001 commented 6 years ago

Fixed it!

mkg20001 commented 6 years ago

Applied the requested changes but now it seems like libp2p-crypto also has the exact same issues with crypto.keys.unmarshalPrivateKey which has a cb

daviddias commented 6 years ago

@mkg20001 CI is failing, see https://circleci.com/gh/libp2p/js-peer-id/226

mkg20001 commented 6 years ago

Yes I see. This is because, as I previously said, the libp2p-crypto module has the exact same error. Which is something that should be handled there. libp2p/js-libp2p-crypto#112

pgte commented 6 years ago

All tests seam to pass when using libp2p/js-libp2p-crypto#113