MCPcopy Create free account
hub / github.com/ceramicnetwork/rust-ceramic / peer_roundtrip

Function peer_roundtrip

core/src/peer.rs:274–289  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

272
273 #[test]
274 fn peer_roundtrip() -> Result<()> {
275 let node_key = NodeKey::random();
276 let entry = PeerEntry::new(
277 node_key.id(),
278 1732211100,
279 ["/ip4/127.0.0.1/tcp/5100", "/ip4/127.0.0.2/udp/5100/quic-v1"]
280 .into_iter()
281 .map(std::str::FromStr::from_str)
282 .collect::<Result<_, _>>()?,
283 );
284 debug!(?entry, "peer entry");
285 let key = PeerKey::from_entry(&entry, &node_key)?;
286 debug!(?key, "peer key");
287 assert_eq!(entry, key.to_entry()?);
288 Ok(())
289 }
290 #[test]
291 fn peer_entry_p2p_multiaddrs() -> Result<()> {
292 let node_key =

Callers

nothing calls this directly

Calls 4

newFunction · 0.85
mapMethod · 0.80
into_iterMethod · 0.80
idMethod · 0.45

Tested by

no test coverage detected