-
Notifications
You must be signed in to change notification settings - Fork 948
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
Ord, Eq, Hash instances for PublicKey for use with collections (sets, maps) #2910
Comments
The way I would generally do this is convert the public key (in my case, ed25519) into a string or bytes and use wrapper around that to implements those traits. Considering that |
I think it is fine to implement traits that we can simply forward to our internal implementations. Most of these missing traits are often just an oversight when wrapping types. The fact that the dalek types don't implement There is an open PR on Unfortunately, that library is pretty much unmaintained from what I can gather so we shouldn't count on that being merged any time soon. However, we can emulate the implementation of Bottom-line: I am in favor of adding these traits. A PR would be very much appreciated! |
My opinion: What @thomaseizinger said above. |
Description
Implement those traits so that
PublicKey
can be used as a key inBTreeSet
,HashSet
,BTreeMap
andHashMap
.Motivation
I want to store a set of public keys for authorization. I can not get away with only storing
PeerId
s because I need to verify signatures.Current Implementation
No implementation for
PublicKey
, but there are implementations forPeerId
.Are you planning to do it yourself in a pull request?
Yes if this enhancement is wanted by maintainers.
The text was updated successfully, but these errors were encountered: