Enforce that ProtocolId is a string (#6953)

* Enforce that ProtocolId is a string

* Fix test
This commit is contained in:
Pierre Krieger
2020-08-26 14:27:30 +02:00
committed by GitHub
parent 8856be80bc
commit 1bd6082cf7
14 changed files with 61 additions and 57 deletions
+2 -2
View File
@@ -419,7 +419,7 @@ impl<B: BlockT, H: ExHashT> Protocol<B, H> {
let transactions_protocol: Cow<'static, [u8]> = Cow::from({
let mut proto = b"/".to_vec();
proto.extend(protocol_id.as_bytes());
proto.extend(protocol_id.as_ref().as_bytes());
proto.extend(b"/transactions/1");
proto
});
@@ -428,7 +428,7 @@ impl<B: BlockT, H: ExHashT> Protocol<B, H> {
let block_announces_protocol: Cow<'static, [u8]> = Cow::from({
let mut proto = b"/".to_vec();
proto.extend(protocol_id.as_bytes());
proto.extend(protocol_id.as_ref().as_bytes());
proto.extend(b"/block-announces/1");
proto
});