mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-31 04:01:02 +00:00
Use TypedLaneId instead of LaneId (#1738)
* TypedLaneId -> LaneId * fix benchmarks compilation
This commit is contained in:
committed by
Bastian Köcher
parent
41daa32acb
commit
03425b33ae
@@ -203,11 +203,11 @@ pub trait CliChain: relay_substrate_client::Chain {
|
||||
|
||||
/// Lane id.
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub struct HexLaneId(pub LaneId);
|
||||
pub struct HexLaneId(pub [u8; 4]);
|
||||
|
||||
impl From<HexLaneId> for LaneId {
|
||||
fn from(lane_id: HexLaneId) -> LaneId {
|
||||
lane_id.0
|
||||
LaneId(lane_id.0)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -215,7 +215,7 @@ impl std::str::FromStr for HexLaneId {
|
||||
type Err = hex::FromHexError;
|
||||
|
||||
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
||||
let mut lane_id = LaneId::default();
|
||||
let mut lane_id = [0u8; 4];
|
||||
hex::decode_to_slice(s, &mut lane_id)?;
|
||||
Ok(HexLaneId(lane_id))
|
||||
}
|
||||
|
||||
@@ -630,7 +630,8 @@ mod tests {
|
||||
msgs_to_refine.push((payload, out_msg_details));
|
||||
}
|
||||
|
||||
let maybe_batches = split_msgs_to_refine::<Rialto, Rococo>([0, 0, 0, 0], msgs_to_refine);
|
||||
let maybe_batches =
|
||||
split_msgs_to_refine::<Rialto, Rococo>(LaneId([0, 0, 0, 0]), msgs_to_refine);
|
||||
match expected_batches {
|
||||
Ok(expected_batches) => {
|
||||
let batches = maybe_batches.unwrap();
|
||||
|
||||
@@ -938,7 +938,7 @@ pub(crate) mod tests {
|
||||
};
|
||||
let _ = run(
|
||||
Params {
|
||||
lane: [0, 0, 0, 0],
|
||||
lane: LaneId([0, 0, 0, 0]),
|
||||
source_tick: Duration::from_millis(100),
|
||||
target_tick: Duration::from_millis(100),
|
||||
reconnect_delay: Duration::from_millis(0),
|
||||
|
||||
Reference in New Issue
Block a user