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

Function roundtrip

core/src/interest.rs:343–355  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

341
342 #[test]
343 fn roundtrip() {
344 let peer_id = PeerId::from_str("1AZtAkWrrQrsXMQuBEcBget2vGAPbdQ2Wn4bESe9QEVypJ").unwrap();
345 let interest = Interest::builder()
346 .with_sep_key("model")
347 .with_peer_id(&peer_id)
348 .with_range((&[0, 1, 2][..], &[0, 1, 9][..]))
349 .with_not_after(0)
350 .build();
351 expect!["zSeLpVyYXXyR6aowRRqCo76S7kDJkqeid8Mcg8v8DdHjBrNdCpB1kSMVvikk6AcgWg7rTgQ7ocLP"]
352 .assert_eq(&interest.to_string());
353
354 assert_eq!(interest, Interest::from_str(&interest.to_string()).unwrap());
355 }
356
357 #[test]
358 fn accessors() {

Callers

nothing calls this directly

Calls 7

unwrapMethod · 0.80
with_not_afterMethod · 0.80
with_rangeMethod · 0.80
with_peer_idMethod · 0.80
with_sep_keyMethod · 0.80
buildMethod · 0.45
to_stringMethod · 0.45

Tested by

no test coverage detected