Skip to content
This repository has been archived by the owner on Feb 29, 2024. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Guantong committed Apr 23, 2023
1 parent eeb62e6 commit b3dc192
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions primitives/messages/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ use bp_runtime::{BasicOperatingMode, OperatingMode};
use source_chain::RelayersRewards;
// paritytech
use frame_support::RuntimeDebug;
use sp_core::TypeId;
use sp_std::{collections::vec_deque::VecDeque, ops::RangeInclusive, prelude::*};

use bp_runtime::messages::MessageDispatchResult;
Expand All @@ -41,6 +42,16 @@ pub use frame_support::weights::Weight;
/// 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]);

impl TypeId for TypedLaneId {
const TYPE_ID: [u8; 4] = *b"blan";
}

/// Message nonce. Valid messages will never have 0 nonce.
pub type MessageNonce = u64;

Expand Down

0 comments on commit b3dc192

Please sign in to comment.