Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
claravanstaden committed Nov 18, 2024
1 parent 490d091 commit bf500d2
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 69 deletions.
9 changes: 5 additions & 4 deletions bridges/snowbridge/pallets/inbound-queue-v2/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@
use crate::{Config, Error};
use snowbridge_core::inbound::Proof;
use snowbridge_router_primitives::inbound::{dry_run::DryRunMessage, v2::Message};
use snowbridge_router_primitives::inbound::v2::{ConvertMessage, Message};
use xcm::latest::Xcm;
pub fn dry_run<T>(message: Message, _proof: Proof) -> Result<(Xcm<()>, u128), Error<T>>

pub fn dry_run<T>(message: Message, _proof: Proof) -> Result<Xcm<()>, Error<T>>
where
T: Config,
{
let _dry_run_result = T::XCMDryRunner::dry_run_xcm(message);
Ok((Xcm::<()>::new(), 0))
let xcm = T::MessageConverter::convert(message).map_err(|e| Error::<T>::ConvertMessage(e))?;
Ok(xcm)
}
6 changes: 1 addition & 5 deletions bridges/snowbridge/pallets/inbound-queue-v2/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,7 @@ use snowbridge_core::{
inbound::{Message, VerificationError, Verifier},
BasicOperatingMode,
};
use snowbridge_router_primitives::inbound::{
dry_run::DryRunMessage,
v2::{ConvertMessage, Message as MessageV2},
};
use snowbridge_router_primitives::inbound::v2::{ConvertMessage, Message as MessageV2};
pub use weights::WeightInfo;

#[cfg(feature = "runtime-benchmarks")]
Expand Down Expand Up @@ -88,7 +85,6 @@ pub mod pallet {

/// XCM message sender
type XcmSender: SendXcm;
type XCMDryRunner: DryRunMessage;
/// Address of the Gateway contract
#[pallet::constant]
type GatewayAddress: Get<H160>;
Expand Down
9 changes: 0 additions & 9 deletions bridges/snowbridge/pallets/inbound-queue-v2/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,6 @@ impl SendXcm for MockXcmSender {
}
}

pub struct MockXcmDryRunner;

impl DryRunMessage for MockXcmDryRunner {
fn dry_run_xcm(_message: Message) -> Result<Xcm<()>, DryRunError> {
Ok(Xcm::<()>::new())
}
}

pub const DOT: u128 = 10_000_000_000;

pub struct MockTokenIdConvert;
Expand All @@ -166,7 +158,6 @@ impl inbound_queue::Config for Test {
type RuntimeEvent = RuntimeEvent;
type Verifier = MockVerifier;
type XcmSender = MockXcmSender;
type XCMDryRunner = MockXcmDryRunner;
type WeightInfo = ();
type GatewayAddress = GatewayAddress;
type AssetHubParaId = ConstU32<1000>;
Expand Down
48 changes: 0 additions & 48 deletions bridges/snowbridge/primitives/router/src/inbound/dry_run.rs

This file was deleted.

1 change: 0 additions & 1 deletion bridges/snowbridge/primitives/router/src/inbound/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// SPDX-FileCopyrightText: 2023 Snowfork <[email protected]>
// SPDX-FileCopyrightText: 2021-2022 Parity Technologies (UK) Ltd.

pub mod dry_run;
pub mod v1;
pub mod v2;
use codec::Encode;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ use parachains_common::{AccountId, Balance};
use snowbridge_beacon_primitives::{Fork, ForkVersions};
use snowbridge_core::{gwei, meth, AllowSiblingsOnly, PricingParameters, Rewards};
use snowbridge_router_primitives::{
inbound::v1::MessageToXcm,
outbound::{v1::EthereumBlobExporter, v2::EthereumBlobExporter as EthereumBlobExporterV2},
};
use sp_core::H160;
Expand Down Expand Up @@ -95,7 +94,7 @@ impl snowbridge_pallet_inbound_queue::Config for Runtime {
type GatewayAddress = EthereumGatewayAddress;
#[cfg(feature = "runtime-benchmarks")]
type Helper = Runtime;
type MessageConverter = MessageToXcm<
type MessageConverter = snowbridge_router_primitives::inbound::v1::MessageToXcm<
CreateAssetCall,
CreateAssetDeposit,
ConstU8<INBOUND_QUEUE_PALLET_INDEX>,
Expand Down Expand Up @@ -124,6 +123,8 @@ impl snowbridge_pallet_inbound_queue_v2::Config for Runtime {
#[cfg(feature = "runtime-benchmarks")]
type Helper = Runtime;
type WeightInfo = crate::weights::snowbridge_pallet_inbound_queue_v2::WeightInfo<Runtime>;
type AssetHubParaId = ConstU32<1000>;
type MessageConverter = snowbridge_router_primitives::inbound::v2::MessageToXcm<EthereumNetwork, ConstU8<INBOUND_QUEUE_PALLET_INDEX>>;
}

impl snowbridge_pallet_outbound_queue::Config for Runtime {
Expand Down

0 comments on commit bf500d2

Please sign in to comment.