-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Calling toString on a peer id breaks deep comparison #141
Comments
Users should not rely on deepEqual in my opinion, as if you create the same PeerId via privateKey, or B58String they are the same PeerId (per Even though, we should address this problem. If this is not a major problem, we should probably wait until we move into using default format from RFC 0001 by default in libp2p |
It's a pretty common test assertion which we can't use. It could be fixed my marking using |
Makes the cached string cid property non-enumerable so deep equals still works even after a peer id has been stringifed. Fixes #141
Makes the cached string cid property non-enumerable so deep equals still works even after a peer id has been stringifed. Fixes #141
This is because
.toString()
has the side effect of setting a._idCIDString
property onthis
which the other peer ID doesn't have.The text was updated successfully, but these errors were encountered: