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

Commit

Permalink
use pallet instance in inbound queue origin
Browse files Browse the repository at this point in the history
  • Loading branch information
claravanstaden authored and claravanstaden committed Dec 1, 2023
1 parent 3008174 commit 084e558
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ use codec::{Decode, Encode};
use frame_support::pallet_prelude::TypeInfo;
use hex_literal::hex;
use snowbridge_core::outbound::OperatingMode;
use snowbridge_rococo_common::EthereumNetwork;
use snowbridge_router_primitives::inbound::{Command, Destination, MessageV1, VersionedMessage};
use snowbridge_system;
use snowbridge_rococo_common::EthereumNetwork;
use sp_core::H256;

const INITIAL_FUND: u128 = 5_000_000_000 * ROCOCO_ED;
Expand Down Expand Up @@ -244,8 +244,7 @@ fn send_token_to_penpal() {
]);

let weth_asset_location: MultiLocation =
(Parent, Parent, EthereumNetwork::get(), AccountKey20 { network: None, key: WETH })
.into();
(Parent, Parent, EthereumNetwork::get(), AccountKey20 { network: None, key: WETH }).into();
let weth_asset_id = weth_asset_location.into();

let origin_location =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ use parachains_common::{
use polkadot_parachain_primitives::primitives::Sibling;
use polkadot_runtime_common::xcm_sender::ExponentialPrice;
use rococo_runtime_constants::system_parachain;
use snowbridge_router_primitives::inbound::GlobalConsensusEthereumConvertsFor;
use snowbridge_rococo_common::EthereumNetwork;
use snowbridge_router_primitives::inbound::GlobalConsensusEthereumConvertsFor;
use sp_runtime::traits::{AccountIdConversion, ConvertInto};
use xcm::latest::prelude::*;
use xcm_builder::{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ use crate::{
xcm_config::{AgentIdOf, UniversalLocation},
Runtime,
};
use snowbridge_router_primitives::outbound::EthereumBlobExporter;
use snowbridge_rococo_common::EthereumNetwork;
use snowbridge_router_primitives::outbound::EthereumBlobExporter;

pub type SnowbridgeExporter = EthereumBlobExporter<
UniversalLocation,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,7 @@ parameter_types! {
pub const GatewayAddress: H160 = H160(hex_literal::hex!("EDa338E4dC46038493b885327842fD3E301CaB39"));
pub const CreateAssetCall: [u8;2] = [53, 0];
pub const CreateAssetDeposit: u128 = (UNITS / 10) + EXISTENTIAL_DEPOSIT;
pub const InboundQueuePalletInstance: u8 = 80;
pub Parameters: PricingParameters<u128> = PricingParameters {
exchange_rate: FixedU128::from_rational(1, 400),
fee_per_gas: gwei(20),
Expand All @@ -536,7 +537,13 @@ impl snowbridge_inbound_queue::Config for Runtime {
type GatewayAddress = GatewayAddress;
#[cfg(feature = "runtime-benchmarks")]
type Helper = Runtime;
type MessageConverter = MessageToXcm<CreateAssetCall, CreateAssetDeposit, AccountId, Balance>;
type MessageConverter = MessageToXcm<
CreateAssetCall,
CreateAssetDeposit,
InboundQueuePalletInstance,
AccountId,
Balance,
>;
type WeightToFee = WeightToFee;
type WeightInfo = weights::snowbridge_inbound_queue::WeightInfo<Runtime>;
type PricingParameters = EthereumSystem;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ use polkadot_parachain_primitives::primitives::Sibling;
use polkadot_runtime_common::xcm_sender::ExponentialPrice;
use rococo_runtime_constants::system_parachain;
use snowbridge_core::DescribeHere;
use snowbridge_runtime_common::XcmExportFeeToSibling;
use snowbridge_rococo_common::EthereumNetwork;
use snowbridge_runtime_common::XcmExportFeeToSibling;
use sp_core::{Get, H256};
use sp_runtime::traits::AccountIdConversion;
use sp_std::marker::PhantomData;
Expand Down Expand Up @@ -469,7 +469,7 @@ impl<WaivedLocations: Contains<MultiLocation>, FeeHandler: HandleFee> FeeManager
fn is_waived(origin: Option<&MultiLocation>, fee_reason: FeeReason) -> bool {
let Some(loc) = origin else { return false };
if let Export { network, destination: Here } = fee_reason {
return !(network == EthereumNetwork::get());
return !(network == EthereumNetwork::get())
}
WaivedLocations::contains(loc)
}
Expand Down

0 comments on commit 084e558

Please sign in to comment.