Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix merge conflicts Backport PR #7089 #7121

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions bridges/snowbridge/primitives/router/src/inbound/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use sp_runtime::{
traits::{IdentifyAccount, MaybeEquivalence, Verify},
MultiSignature,
};
use xcm::{latest::WESTEND_GENESIS_HASH, prelude::*};
use xcm::prelude::*;

pub const CHAIN_ID: u64 = 11155111;
pub const NETWORK: NetworkId = Ethereum { chain_id: CHAIN_ID };
Expand All @@ -18,8 +18,8 @@ parameter_types! {
pub const SendTokenExecutionFee: u128 = 1_000_000_000;
pub const InboundQueuePalletInstance: u8 = 80;
pub UniversalLocation: InteriorLocation =
[GlobalConsensus(ByGenesis(WESTEND_GENESIS_HASH)), Parachain(1002)].into();
pub AssetHubFromEthereum: Location = Location::new(1,[GlobalConsensus(ByGenesis(WESTEND_GENESIS_HASH)),Parachain(1000)]);
[GlobalConsensus(Westend), Parachain(1002)].into();
pub AssetHubFromEthereum: Location = Location::new(1,[GlobalConsensus(Westend),Parachain(1000)]);
}

type Signature = MultiSignature;
Expand Down
6 changes: 0 additions & 6 deletions bridges/snowbridge/primitives/router/src/inbound/tests.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
<<<<<<< HEAD
use super::GlobalConsensusEthereumConvertsFor;
use crate::inbound::CallIndex;
use frame_support::{assert_ok, parameter_types};
=======
use super::EthereumLocationsConverterFor;
use crate::inbound::{
mock::*, Command, ConvertMessage, Destination, MessageV1, VersionedMessage, H160,
};
use frame_support::assert_ok;
>>>>>>> 4059282f (Snowbridge: Support bridging native ETH (#6855))
use hex_literal::hex;
use xcm::prelude::*;
use xcm_executor::traits::ConvertLocation;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,8 @@ fn send_eth_asset_from_asset_hub_to_ethereum_and_back() {
let assethub_location = BridgeHubRococo::sibling_location_of(AssetHubRococo::para_id());
let assethub_sovereign = BridgeHubRococo::sovereign_account_id_of(assethub_location);
let ethereum_sovereign: AccountId =
EthereumLocationsConverterFor::<AccountId>::convert_location(&origin_location).unwrap();
GlobalConsensusEthereumConvertsFor::<AccountId>::convert_location(&origin_location)
.unwrap();

AssetHubRococo::force_default_xcm_version(Some(XCM_VERSION));
BridgeHubRococo::force_default_xcm_version(Some(XCM_VERSION));
Expand Down Expand Up @@ -733,18 +734,11 @@ fn register_weth_token_in_asset_hub_fail_for_insufficient_fee() {
});
}

<<<<<<< HEAD
fn send_token_from_ethereum_to_asset_hub_with_fee(account_id: [u8; 32], fee: u128) {
fn send_weth_from_ethereum_to_asset_hub_with_fee(account_id: [u8; 32], fee: u128) {
let weth_asset_location: Location = Location::new(
2,
[EthereumNetwork::get().into(), AccountKey20 { network: None, key: WETH }],
);
=======
fn send_weth_from_ethereum_to_asset_hub_with_fee(account_id: [u8; 32], fee: u128) {
let ethereum_network_v5: NetworkId = EthereumNetwork::get().into();
let weth_asset_location: Location =
Location::new(2, [ethereum_network_v5.into(), AccountKey20 { network: None, key: WETH }]);
>>>>>>> 4059282f (Snowbridge: Support bridging native ETH (#6855))
// Fund asset hub sovereign on bridge hub
let asset_hub_sovereign = BridgeHubRococo::sovereign_account_id_of(Location::new(
1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ use asset_hub_rococo_runtime::{
AllPalletsWithoutSystem, AssetConversion, AssetDeposit, Assets, Balances, Block,
CollatorSelection, ExistentialDeposit, ForeignAssets, ForeignAssetsInstance,
MetadataDepositBase, MetadataDepositPerByte, ParachainSystem, Runtime, RuntimeCall,
RuntimeEvent, RuntimeOrigin, SessionKeys, ToWestendXcmRouterInstance, TrustBackedAssetsInstance, XcmpQueue,
RuntimeEvent, RuntimeOrigin, SessionKeys, ToWestendXcmRouterInstance,
TrustBackedAssetsInstance, XcmpQueue,
};
use asset_test_utils::{
test_cases_over_bridge::TestBridgingConfig, CollatorSessionKey, CollatorSessionKeys,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1695,8 +1695,10 @@ where
0,
test_account
));
let execution_fees =
Runtime::query_weight_to_asset_fee(xcm_weight.unwrap(), VersionedAssetId::from(AssetId(asset_not_in_pool)));
let execution_fees = Runtime::query_weight_to_asset_fee(
xcm_weight.unwrap(),
VersionedAssetId::from(AssetId(asset_not_in_pool)),
);
// Now it works!
assert_ok!(execution_fees);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@

use bp_polkadot_core::Signature;
use bridge_hub_rococo_runtime::{
bridge_common_config, bridge_to_bulletin_config,
bridge_to_ethereum_config::EthereumGatewayAddress,
bridge_common_config, bridge_to_bulletin_config, bridge_to_westend_config,
bridge_to_westend_config,
xcm_config::{LocationToAccountId, RelayNetwork, TokenLocation, XcmConfig},
AllPalletsWithoutSystem, Block, BridgeRejectObsoleteHeadersAndMessages, Executive,
ExistentialDeposit, ParachainSystem, PolkadotXcm, Runtime, RuntimeCall, RuntimeEvent,
Expand Down
16 changes: 16 additions & 0 deletions prdoc/pr_7089.prdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Schema: Polkadot SDK PRDoc Schema (prdoc) v1.0.0
# See doc at https://raw.githubusercontent.com/paritytech/polkadot-sdk/master/prdoc/schema_user.json

title: [stable2409] Backport Snowbridge - Support bridging native ETH

doc:
- audience: Runtime User
description:
Support Native ETH as an asset type instead of only supporting WETH. WETH is still supported, but adds
support for ETH in the inbound and outbound routers.

crates:
- name: snowbridge-router-primitives
bump: minor
- name: snowbridge-pallet-inbound-queue-fixtures
bump: minor
Loading