Enforce that ProtocolId is a string (#6953)

* Enforce that ProtocolId is a string

* Fix test
This commit is contained in:
Pierre Krieger authored and GitHub committed 2020-08-26 12:27:30 +00:00
1 parent 8856be80bc
commit 1bd6082cf7
14 files changed
+61 -57

No files matched your search

@@ -83,7 +83,7 @@ fn build_nodes() -> (Swarm<CustomProtoWithAddr>, Swarm<CustomProtoWithAddr>) {
});
let behaviour = CustomProtoWithAddr {
inner: GenericProto::new(local_peer_id, &b"test"[..], &[1], vec![], peerset),
inner: GenericProto::new(local_peer_id, "test", &[1], vec![], peerset),
addrs: addrs
.iter()
.enumerate()
@@ -49,7 +49,7 @@ impl RegisteredProtocol {
-> Self {
let protocol = protocol.into();
let mut base_name = b"/substrate/".to_vec();
base_name.extend_from_slice(protocol.as_bytes());
base_name.extend_from_slice(protocol.as_ref().as_bytes());
base_name.extend_from_slice(b"/");
RegisteredProtocol {