Skip to content

Commit

Permalink
Testing nits
Browse files Browse the repository at this point in the history
  • Loading branch information
bkontur committed Sep 20, 2024
1 parent 4835750 commit bebaba1
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 16 deletions.
2 changes: 1 addition & 1 deletion bridges/modules/relayers/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const REWARD_AMOUNT: u32 = u32::MAX;
pub struct Pallet<T: Config<I>, I: 'static = ()>(crate::Pallet<T, I>);

/// Trait that must be implemented by runtime.
pub trait Config<I: 'static>: crate::Config<I> {
pub trait Config<I: 'static = ()>: crate::Config<I> {
/// Lane id to use in benchmarks.
fn bench_lane_id() -> Self::LaneId {
Self::LaneId::default()
Expand Down
2 changes: 1 addition & 1 deletion bridges/modules/relayers/src/extension/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ where
let lane_id = pre
.as_ref()
.and_then(|p| p.as_ref())
.map(|p| p.call_info.messages_call_info().lane_id().clone());
.map(|p| p.call_info.messages_call_info().lane_id());
let call_result = Self::analyze_call_result(pre, info, post_info, len, result);

match call_result {
Expand Down
2 changes: 1 addition & 1 deletion bridges/modules/relayers/src/migration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ pub mod v1 {
// re-register rewards with new format of `RewardsAccountParams`.
for (key1, key2, reward) in rewards_to_migrate {
// expand old key
let v0::RewardsAccountParams { owner, lane_id, bridged_chain_id } = key2.clone();
let v0::RewardsAccountParams { owner, lane_id, bridged_chain_id } = key2;

// re-register reward
Pallet::<T, I>::register_relayer_reward(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1242,15 +1242,20 @@ impl_runtime_apis! {
);

// open bridge
let origin = RuntimeOrigin::from(pallet_xcm::Origin::Xcm(sibling_parachain_location.clone()));
XcmOverBridgeHubWestend::open_bridge(
origin.clone(),
Box::new(VersionedInteriorLocation::from([GlobalConsensus(NetworkId::Westend), Parachain(8765)])),
let bridge_destination_universal_location: InteriorLocation = [GlobalConsensus(NetworkId::Westend), Parachain(8765)].into();
let locations = XcmOverBridgeHubWestend::bridge_locations(
sibling_parachain_location.clone(),
bridge_destination_universal_location.clone(),
)?;
XcmOverBridgeHubWestend::do_open_bridge(
locations,
bp_messages::LegacyLaneId([1, 2, 3, 4]),
true,
).map_err(|e| {
log::error!(
"Failed to `XcmOverBridgeHubWestend::open_bridge`({:?}, {:?})`, error: {:?}",
origin,
[GlobalConsensus(NetworkId::Westend), Parachain(8765)],
sibling_parachain_location,
bridge_destination_universal_location,
e
);
BenchmarkError::Stop("Bridge was not opened!")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1135,15 +1135,20 @@ impl_runtime_apis! {
);

// open bridge
let origin = RuntimeOrigin::from(pallet_xcm::Origin::Xcm(sibling_parachain_location.clone()));
XcmOverBridgeHubRococo::open_bridge(
origin.clone(),
alloc::boxed::Box::new(VersionedInteriorLocation::from([GlobalConsensus(NetworkId::Rococo), Parachain(8765)])),
let bridge_destination_universal_location: InteriorLocation = [GlobalConsensus(NetworkId::Rococo), Parachain(8765)].into();
let locations = XcmOverBridgeHubRococo::bridge_locations(
sibling_parachain_location.clone(),
bridge_destination_universal_location.clone(),
)?;
XcmOverBridgeHubRococo::do_open_bridge(
locations,
bp_messages::LegacyLaneId([1, 2, 3, 4]),
true,
).map_err(|e| {
log::error!(
"Failed to `XcmOverBridgeHubRococo::open_bridge`({:?}, {:?})`, error: {:?}",
origin,
[GlobalConsensus(NetworkId::Rococo), Parachain(8765)],
sibling_parachain_location,
bridge_destination_universal_location,
e
);
BenchmarkError::Stop("Bridge was not opened!")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# this image is built on top of existing Zombienet image
ARG ZOMBIENET_IMAGE
# this image uses substrate-relay image built elsewhere
ARG SUBSTRATE_RELAY_IMAGE=docker.io/paritytech/substrate-relay:v1.6.8
ARG SUBSTRATE_RELAY_IMAGE=docker.io/paritytech/substrate-relay:v1.6.10

# metadata
ARG VCS_REF
Expand Down

0 comments on commit bebaba1

Please sign in to comment.