Skip to content

Commit ab7ed43

Browse files
cobwardmxinden
andauthored
core/src/transport/memory: Test parse_memory_addr with PeerId (#2468)
Co-authored-by: Max Inden <[email protected]>
1 parent 8d13666 commit ab7ed43

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

core/src/transport/memory.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,22 @@ mod tests {
388388
parse_memory_addr(&"/memory/1234567890".parse().unwrap()),
389389
Ok(1_234_567_890)
390390
);
391+
assert_eq!(
392+
parse_memory_addr(
393+
&"/memory/5/p2p/12D3KooWETLZBFBfkzvH3BQEtA1TJZPmjb4a18ss5TpwNU7DHDX6"
394+
.parse()
395+
.unwrap()
396+
),
397+
Ok(5)
398+
);
399+
assert_eq!(
400+
parse_memory_addr(
401+
&"/memory/5/p2p/12D3KooWETLZBFBfkzvH3BQEtA1TJZPmjb4a18ss5TpwNU7DHDX6/p2p-circuit/p2p/12D3KooWLiQ7i8sY6LkPvHmEymncicEgzrdpXegbxEr3xgN8oxMU"
402+
.parse()
403+
.unwrap()
404+
),
405+
Ok(5)
406+
);
391407
}
392408

393409
#[test]

0 commit comments

Comments
 (0)