rust-libp2p
rust-libp2p copied to clipboard
`PeerId::from_bytes` should be const
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