-
Notifications
You must be signed in to change notification settings - Fork 1.1k
PeerId::from_bytes
should be const
#5864
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
Comments
Hi, and thanks for the interest! |
It seems like the only method which is From searching on the |
For the time being wouldnt it be possible for you to use |
Yes I've resolved it by just using a function returning the same peer id in my tests thanks! But if it's still possible to add const to PeerId I think it's worth keeping the issue open |
Oops, seems like we needed more information for this issue, please comment with more details or this issue will be closed in 7 days. |
Description
There's currently no way to create a PeerId in a const context.
Motivation
I'm writing unit tests, and I need a global PeerId shared between tests. A const peer id would be great for this.
Current Implementation
My work around is just to call
PeerId::from_bytes
every time using the same bytes.Are you planning to do it yourself in a pull request?
No
The text was updated successfully, but these errors were encountered: