mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-28 06:17:56 +00:00
Enforce that ProtocolId is a string (#6953)
* Enforce that ProtocolId is a string * Fix test
This commit is contained in:
@@ -156,13 +156,13 @@ impl Config {
|
||||
pub fn set_protocol(&mut self, id: &ProtocolId) -> &mut Self {
|
||||
let mut vl = Vec::new();
|
||||
vl.extend_from_slice(b"/");
|
||||
vl.extend_from_slice(id.as_bytes());
|
||||
vl.extend_from_slice(id.as_ref().as_bytes());
|
||||
vl.extend_from_slice(b"/light/2");
|
||||
self.light_protocol = vl.into();
|
||||
|
||||
let mut vb = Vec::new();
|
||||
vb.extend_from_slice(b"/");
|
||||
vb.extend_from_slice(id.as_bytes());
|
||||
vb.extend_from_slice(id.as_ref().as_bytes());
|
||||
vb.extend_from_slice(b"/sync/2");
|
||||
self.block_protocol = vb.into();
|
||||
|
||||
@@ -1447,7 +1447,7 @@ mod tests {
|
||||
}
|
||||
|
||||
fn make_config() -> super::Config {
|
||||
super::Config::new(&ProtocolId::from(&b"foo"[..]))
|
||||
super::Config::new(&ProtocolId::from("foo"))
|
||||
}
|
||||
|
||||
fn dummy_header() -> sp_test_primitives::Header {
|
||||
|
||||
Reference in New Issue
Block a user