[Substrate companion] update libp2p to 0.52.0 (#7472)

* update tinyvec to 1.6.0

* update once_cell to 1.18.0

* update data-encoding to 2.4.0

* update libc

* update js-sys

* update wasm-bindgen-futures

* update pin-project

* update tokio

* update syn

* p2p protocol now contains `PeerId`

not multihash

* update arrayvec to 0.7.4

* update sha2

* update smallvec

* updates to Cargo.lock after merge

* redo dep updates

* update lru

in attempt to compile polkadot

* update lockfile for {"substrate"}

---------

Co-authored-by: parity-processbot <>
This commit is contained in:
Anton
2023-07-25 18:24:59 +04:00
committed by GitHub
parent 30e1c2a551
commit 7a1d96e1ce
25 changed files with 626 additions and 1583 deletions
@@ -156,7 +156,7 @@ impl<N: Network, AD: AuthorityDiscovery> Service<N, AD> {
fn extract_peer_ids(multiaddr: impl Iterator<Item = Multiaddr>) -> HashSet<PeerId> {
multiaddr
.filter_map(|mut addr| match addr.pop() {
Some(multiaddr::Protocol::P2p(key)) => PeerId::from_multihash(key).ok(),
Some(multiaddr::Protocol::P2p(peer_id)) => Some(peer_id),
_ => None,
})
.collect()
@@ -207,7 +207,7 @@ mod tests {
let authorities = known_authorities();
let multiaddr = known_multiaddr().into_iter().zip(peer_ids.iter().cloned()).map(
|(mut addr, peer_id)| {
addr.push(multiaddr::Protocol::P2p(peer_id.into()));
addr.push(multiaddr::Protocol::P2p(peer_id));
HashSet::from([addr])
},
);