Use TypedLaneId instead of LaneId (#1738)

* TypedLaneId -> LaneId

* fix benchmarks compilation
This commit is contained in:
Svyatoslav Nikolsky
2022-12-30 12:09:19 +03:00
committed by Bastian Köcher
parent 41daa32acb
commit 03425b33ae
20 changed files with 65 additions and 50 deletions
+22 -8
View File
@@ -67,16 +67,30 @@ impl OperatingMode for MessagesOperatingMode {
}
}
/// Lane identifier.
pub type LaneId = [u8; 4];
/// Lane id which implements `TypeId`.
// TODO (https://github.com/paritytech/parity-bridges-common/issues/1694):
// `LaneId` shall be replaced with this across all codebase (codec-compatible)
#[derive(Decode, Encode, RuntimeDebug)]
pub struct TypedLaneId(pub [u8; 4]);
#[derive(
Clone,
Copy,
Decode,
Default,
Encode,
Eq,
Ord,
PartialOrd,
PartialEq,
RuntimeDebug,
TypeInfo,
MaxEncodedLen,
)]
pub struct LaneId(pub [u8; 4]);
impl TypeId for TypedLaneId {
impl AsRef<[u8]> for LaneId {
fn as_ref(&self) -> &[u8] {
&self.0
}
}
impl TypeId for LaneId {
const TYPE_ID: [u8; 4] = *b"blan";
}