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
@@ -28,7 +28,7 @@ use bridge_runtime_common::messages::{self, MessageBridge};
use frame_support::{parameter_types, weights::Weight, RuntimeDebug};
/// Lane that is used for XCM messages exchange.
pub const XCM_LANE: LaneId = [0, 0, 0, 0];
pub const XCM_LANE: LaneId = LaneId([0, 0, 0, 0]);
/// Weight of 2 XCM instructions is for simple `Trap(42)` program, coming through bridge
/// (it is prepended with `UniversalOrigin` instruction). It is used just for simplest manual
/// tests, confirming that we don't break encoding somewhere between.
+3 -3
View File
@@ -204,7 +204,7 @@ impl XcmBridge for ToMillauBridge {
}
fn xcm_lane() -> bp_messages::LaneId {
[0, 0, 0, 0]
bp_messages::LaneId([0, 0, 0, 0])
}
}
@@ -214,7 +214,7 @@ mod tests {
use crate::millau_messages::WeightCredit;
use bp_messages::{
target_chain::{DispatchMessage, DispatchMessageData, MessageDispatch},
MessageKey,
LaneId, MessageKey,
};
use bp_runtime::messages::MessageDispatchResult;
use bridge_runtime_common::messages::target::FromBridgedChainMessageDispatch;
@@ -257,7 +257,7 @@ mod tests {
let xcm: Xcm<RuntimeCall> = vec![Instruction::Trap(42)].into();
let mut incoming_message = DispatchMessage {
key: MessageKey { lane_id: [0, 0, 0, 0], nonce: 1 },
key: MessageKey { lane_id: LaneId([0, 0, 0, 0]), nonce: 1 },
data: DispatchMessageData { payload: Ok((location, xcm).into()) },
};