mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-07-03 19:51:33 +00:00
feat: upgrade multihash (#1792)
* feat: upgrade to multihash 0.13 `multihash` changes a lot internally, it is using stack allocation instead of heap allocation. This leads to a few limitations in regards on how `Multihash` can be used. Therefore `PeerId` is now using a `Bytes` internally so that only minimal changes are needed. * Update versions and changelogs. Co-authored-by: Roman Borschel <romanb@users.noreply.github.com> Co-authored-by: Roman S. Borschel <roman@parity.io>
This commit is contained in:
@ -589,7 +589,7 @@ mod tests {
|
||||
macro_rules! testgen {
|
||||
($runtime_name:ident, $service_name:ty, $block_on_fn:tt) => {
|
||||
mod $runtime_name {
|
||||
use libp2p_core::{PeerId, multiaddr::multihash};
|
||||
use libp2p_core::{PeerId, multihash::{Code, MultihashDigest}};
|
||||
use std::time::Duration;
|
||||
use crate::service::MdnsPacket;
|
||||
|
||||
@ -683,7 +683,7 @@ mod tests {
|
||||
#[test]
|
||||
fn discover_long_peer_id() {
|
||||
let max_value = String::from_utf8(vec![b'f'; 42]).unwrap();
|
||||
let hash = multihash::Identity::digest(max_value.as_ref());
|
||||
let hash = Code::Identity.digest(max_value.as_ref());
|
||||
discover(PeerId::from_multihash(hash).unwrap())
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user