rust-libp2p icon indicating copy to clipboard operation
rust-libp2p copied to clipboard

`PeerId::from_bytes` should be const

Open tqwewe opened this issue 8 months ago • 5 comments

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

tqwewe avatar Feb 17 '25 08:02 tqwewe