Skip to content
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
7 changes: 4 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ jobs:
####### This job must not be skipped (otherwise the ts-tests are not run)

prepare-polkadot:
runs-on: ubuntu-latest
runs-on: bare-metal
needs: ["set-tags"]
steps:
- name: Checkout
Expand All @@ -231,6 +231,7 @@ jobs:
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
registry: index.docker.io
- name: Check & build polkadot docker image
run: |
POLKADOT_REPO=${{ needs.set-tags.outputs.polkadot_repo }}
Expand All @@ -247,12 +248,12 @@ jobs:
run: |
POLKADOT_REPO=${{ needs.set-tags.outputs.polkadot_repo }}
POLKADOT_COMMIT=${{ needs.set-tags.outputs.polkadot_commit }}
DOCKER_TAG="purestake/polkadot-para-tests:sha-$POLKADOT_COMMIT"
DOCKER_TAG="docker.io/purestake/polkadot-para-tests:sha-$POLKADOT_COMMIT"
POLKADOT_EXISTS=$(docker manifest inspect $DOCKER_TAG > /dev/null && \
echo "true" || echo "false")
if [[ "$POLKADOT_EXISTS" == "false" ]]; then
mkdir -p build
MOONBEAM_DOCKER_TAG="purestake/moonbase-relay-testnet:sha-$POLKADOT_COMMIT"
MOONBEAM_DOCKER_TAG="docker.io/purestake/moonbase-relay-testnet:sha-$POLKADOT_COMMIT"
# Clear the dummy container if it wasn't properly cleaned up
docker rm -f dummy 2> /dev/null | true
docker create --pull always -ti --name dummy $MOONBEAM_DOCKER_TAG bash
Expand Down
122 changes: 61 additions & 61 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion runtime/moonbase/src/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ pub type LocationToAccountId = (
// If we receive a MultiLocation of type AccountKey20, just generate a native account
AccountKey20Aliases<RelayNetwork, AccountId>,
// Generate remote accounts according to polkadot standards
xcm_builder::ForeignChainAliasAccount<AccountId>,
xcm_builder::HashedDescriptionDescribeFamilyAllTerminal<AccountId>,
);

/// Wrapper type around `LocationToAccountId` to convert an `AccountId` to type `H160`.
Expand Down
2 changes: 1 addition & 1 deletion runtime/moonbase/tests/integration_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3001,7 +3001,7 @@ fn test_xcm_utils_ml_tp_account() {
),
);
let expected_address_alice_in_parachain_2000: H160 =
xcm_builder::ForeignChainAliasAccount::<AccountId>::convert_ref(
xcm_builder::HashedDescriptionDescribeFamilyAllTerminal::<AccountId>::convert_ref(
alice_in_parachain_2000_multilocation.clone(),
)
.unwrap()
Expand Down
2 changes: 1 addition & 1 deletion runtime/moonbase/tests/xcm_mock/parachain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ pub type LocationToAccountId = (
SiblingParachainConvertsVia<Sibling, AccountId>,
AccountKey20Aliases<RelayNetwork, AccountId>,
// The rest of multilocations convert via hashing it
xcm_builder::ForeignChainAliasAccount<AccountId>,
xcm_builder::HashedDescriptionDescribeFamilyAllTerminal<AccountId>,
);

/// This is the type we use to convert an (incoming) XCM origin into a local `Origin` instance,
Expand Down
9 changes: 5 additions & 4 deletions runtime/moonbase/tests/xcm_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ use pallet_xcm_transactor::{
use sp_std::boxed::Box;
use xcm::latest::prelude::*;
use xcm::{VersionedMultiLocation, WrapVersion};
use xcm_builder::HashedDescriptionDescribeFamilyAllTerminal;
use xcm_executor::traits::Convert;
use xcm_mock::*;
use xcm_primitives::{UtilityEncodeCall, DEFAULT_PROOF_SIZE};
Expand Down Expand Up @@ -2734,7 +2735,7 @@ fn transact_through_signed_multilocation_para_to_para() {
.reanchor(&para_b_location, ancestry.interior)
.unwrap();

let derived = xcm_builder::ForeignChainAliasAccount::<parachain::AccountId>::convert_ref(
let derived = HashedDescriptionDescribeFamilyAllTerminal::<parachain::AccountId>::convert_ref(
descend_origin_multilocation,
)
.unwrap();
Expand Down Expand Up @@ -2843,7 +2844,7 @@ fn transact_through_signed_multilocation_para_to_para_ethereum() {
.reanchor(&para_b_location, ancestry.interior)
.unwrap();

let derived = xcm_builder::ForeignChainAliasAccount::<parachain::AccountId>::convert_ref(
let derived = HashedDescriptionDescribeFamilyAllTerminal::<parachain::AccountId>::convert_ref(
descend_origin_multilocation,
)
.unwrap();
Expand Down Expand Up @@ -2969,7 +2970,7 @@ fn transact_through_signed_multilocation_para_to_para_ethereum_no_proxy_fails()
.reanchor(&para_b_location, ancestry.interior)
.unwrap();

let derived = xcm_builder::ForeignChainAliasAccount::<parachain::AccountId>::convert_ref(
let derived = HashedDescriptionDescribeFamilyAllTerminal::<parachain::AccountId>::convert_ref(
descend_origin_multilocation,
)
.unwrap();
Expand Down Expand Up @@ -3091,7 +3092,7 @@ fn transact_through_signed_multilocation_para_to_para_ethereum_proxy_succeeds()
.reanchor(&para_b_location, ancestry.interior)
.unwrap();

let derived = xcm_builder::ForeignChainAliasAccount::<parachain::AccountId>::convert_ref(
let derived = HashedDescriptionDescribeFamilyAllTerminal::<parachain::AccountId>::convert_ref(
descend_origin_multilocation,
)
.unwrap();
Expand Down
2 changes: 1 addition & 1 deletion runtime/moonbeam/src/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ pub type LocationToAccountId = (
// If we receive a MultiLocation of type AccountKey20, just generate a native account
AccountKey20Aliases<RelayNetwork, AccountId>,
// Generate remote accounts according to polkadot standards
xcm_builder::ForeignChainAliasAccount<AccountId>,
xcm_builder::HashedDescriptionDescribeFamilyAllTerminal<AccountId>,
);

/// Wrapper type around `LocationToAccountId` to convert an `AccountId` to type `H160`.
Expand Down
2 changes: 1 addition & 1 deletion runtime/moonbeam/tests/integration_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2875,7 +2875,7 @@ fn test_xcm_utils_ml_tp_account() {
),
);
let expected_address_alice_in_parachain_2000: H160 =
xcm_builder::ForeignChainAliasAccount::<AccountId>::convert_ref(
xcm_builder::HashedDescriptionDescribeFamilyAllTerminal::<AccountId>::convert_ref(
alice_in_parachain_2000_multilocation.clone(),
)
.unwrap()
Expand Down
2 changes: 1 addition & 1 deletion runtime/moonbeam/tests/xcm_mock/parachain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ pub type LocationToAccountId = (
SiblingParachainConvertsVia<Sibling, AccountId>,
AccountKey20Aliases<RelayNetwork, AccountId>,
// Generate remote accounts according to polkadot standards
xcm_builder::ForeignChainAliasAccount<AccountId>,
xcm_builder::HashedDescriptionDescribeFamilyAllTerminal<AccountId>,
);

/// This is the type we use to convert an (incoming) XCM origin into a local `Origin` instance,
Expand Down
9 changes: 5 additions & 4 deletions runtime/moonbeam/tests/xcm_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ use pallet_xcm_transactor::{
use sp_core::ConstU32;
use xcm::latest::prelude::*;
use xcm::{VersionedMultiLocation, WrapVersion};
use xcm_builder::HashedDescriptionDescribeFamilyAllTerminal;
use xcm_executor::traits::Convert;
use xcm_mock::parachain;
use xcm_mock::relay_chain;
Expand Down Expand Up @@ -2457,7 +2458,7 @@ fn transact_through_signed_multilocation_para_to_para() {
.reanchor(&para_b_location, ancestry.interior)
.unwrap();

let derived = xcm_builder::ForeignChainAliasAccount::<parachain::AccountId>::convert_ref(
let derived = HashedDescriptionDescribeFamilyAllTerminal::<parachain::AccountId>::convert_ref(
descend_origin_multilocation,
)
.unwrap();
Expand Down Expand Up @@ -2566,7 +2567,7 @@ fn transact_through_signed_multilocation_para_to_para_ethereum() {
.reanchor(&para_b_location, ancestry.interior)
.unwrap();

let derived = xcm_builder::ForeignChainAliasAccount::<parachain::AccountId>::convert_ref(
let derived = HashedDescriptionDescribeFamilyAllTerminal::<parachain::AccountId>::convert_ref(
descend_origin_multilocation,
)
.unwrap();
Expand Down Expand Up @@ -2692,7 +2693,7 @@ fn transact_through_signed_multilocation_para_to_para_ethereum_no_proxy_fails()
.reanchor(&para_b_location, ancestry.interior)
.unwrap();

let derived = xcm_builder::ForeignChainAliasAccount::<parachain::AccountId>::convert_ref(
let derived = HashedDescriptionDescribeFamilyAllTerminal::<parachain::AccountId>::convert_ref(
descend_origin_multilocation,
)
.unwrap();
Expand Down Expand Up @@ -2814,7 +2815,7 @@ fn transact_through_signed_multilocation_para_to_para_ethereum_proxy_succeeds()
.reanchor(&para_b_location, ancestry.interior)
.unwrap();

let derived = xcm_builder::ForeignChainAliasAccount::<parachain::AccountId>::convert_ref(
let derived = HashedDescriptionDescribeFamilyAllTerminal::<parachain::AccountId>::convert_ref(
descend_origin_multilocation,
)
.unwrap();
Expand Down
2 changes: 1 addition & 1 deletion runtime/moonriver/src/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ pub type LocationToAccountId = (
// If we receive a MultiLocation of type AccountKey20, just generate a native account
AccountKey20Aliases<RelayNetwork, AccountId>,
// Generate remote accounts according to polkadot standards
xcm_builder::ForeignChainAliasAccount<AccountId>,
xcm_builder::HashedDescriptionDescribeFamilyAllTerminal<AccountId>,
);

/// Wrapper type around `LocationToAccountId` to convert an `AccountId` to type `H160`.
Expand Down
2 changes: 1 addition & 1 deletion runtime/moonriver/tests/integration_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2784,7 +2784,7 @@ fn test_xcm_utils_ml_tp_account() {
),
);
let expected_address_alice_in_parachain_2000: H160 =
xcm_builder::ForeignChainAliasAccount::<AccountId>::convert_ref(
xcm_builder::HashedDescriptionDescribeFamilyAllTerminal::<AccountId>::convert_ref(
alice_in_parachain_2000_multilocation.clone(),
)
.unwrap()
Expand Down
2 changes: 1 addition & 1 deletion runtime/moonriver/tests/xcm_mock/parachain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ pub type LocationToAccountId = (
SiblingParachainConvertsVia<Sibling, AccountId>,
AccountKey20Aliases<RelayNetwork, AccountId>,
// Generate remote accounts according to polkadot standards
xcm_builder::ForeignChainAliasAccount<AccountId>,
xcm_builder::HashedDescriptionDescribeFamilyAllTerminal<AccountId>,
);

/// This is the type we use to convert an (incoming) XCM origin into a local `Origin` instance,
Expand Down
9 changes: 5 additions & 4 deletions runtime/moonriver/tests/xcm_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ use pallet_asset_manager::LocalAssetIdCreator;
use sp_core::ConstU32;
use xcm::latest::prelude::*;
use xcm::{VersionedMultiLocation, WrapVersion};
use xcm_builder::HashedDescriptionDescribeFamilyAllTerminal;
use xcm_executor::traits::Convert;
use xcm_mock::parachain;
use xcm_mock::relay_chain;
Expand Down Expand Up @@ -2769,7 +2770,7 @@ fn transact_through_signed_multilocation_para_to_para() {
.reanchor(&para_b_location, ancestry.interior)
.unwrap();

let derived = xcm_builder::ForeignChainAliasAccount::<parachain::AccountId>::convert_ref(
let derived = HashedDescriptionDescribeFamilyAllTerminal::<parachain::AccountId>::convert_ref(
descend_origin_multilocation,
)
.unwrap();
Expand Down Expand Up @@ -2878,7 +2879,7 @@ fn transact_through_signed_multilocation_para_to_para_ethereum() {
.reanchor(&para_b_location, ancestry.interior)
.unwrap();

let derived = xcm_builder::ForeignChainAliasAccount::<parachain::AccountId>::convert_ref(
let derived = HashedDescriptionDescribeFamilyAllTerminal::<parachain::AccountId>::convert_ref(
descend_origin_multilocation,
)
.unwrap();
Expand Down Expand Up @@ -3004,7 +3005,7 @@ fn transact_through_signed_multilocation_para_to_para_ethereum_no_proxy_fails()
.reanchor(&para_b_location, ancestry.interior)
.unwrap();

let derived = xcm_builder::ForeignChainAliasAccount::<parachain::AccountId>::convert_ref(
let derived = HashedDescriptionDescribeFamilyAllTerminal::<parachain::AccountId>::convert_ref(
descend_origin_multilocation,
)
.unwrap();
Expand Down Expand Up @@ -3126,7 +3127,7 @@ fn transact_through_signed_multilocation_para_to_para_ethereum_proxy_succeeds()
.reanchor(&para_b_location, ancestry.interior)
.unwrap();

let derived = xcm_builder::ForeignChainAliasAccount::<parachain::AccountId>::convert_ref(
let derived = HashedDescriptionDescribeFamilyAllTerminal::<parachain::AccountId>::convert_ref(
descend_origin_multilocation,
)
.unwrap();
Expand Down
25 changes: 4 additions & 21 deletions tests/util/xcm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,28 +129,11 @@ export function descendOriginFromAddress20(
paraId: number = 1
) {
const toHash = new Uint8Array([
...new TextEncoder().encode("ForeignChainAliasAccountPrefix_Para20"),
...context.polkadotApi.createType("u32", paraId).toU8a(),
...new TextEncoder().encode("SiblingChain"),
...context.polkadotApi.createType("Compact<u32>", paraId).toU8a(),
...context.polkadotApi.createType("Compact<u32>", "AccountKey20".length + 20).toU8a(),
...new TextEncoder().encode("AccountKey20"),
...context.polkadotApi.createType("AccountId", address).toU8a(),
...new Uint8Array([1]),
]);

return {
originAddress: address,
descendOriginAddress: u8aToHex(context.polkadotApi.registry.hash(toHash).slice(0, 20)),
};
}

export function descendOriginFromAddress32(
context: DevTestContext,
address: string,
paraId: number = 1
) {
const toHash = new Uint8Array([
...new TextEncoder().encode("ForeignChainAliasAccountPrefix_Para32"),
...context.polkadotApi.createType("u32", paraId).toU8a(),
...context.polkadotApi.createType("AccountId", address).toU8a(),
...new Uint8Array([1]),
]);

return {
Expand Down