Skip to content

[AHs] Support registering assets on Asset Hubs over bridge#5435

Merged
acatangiu merged 10 commits into
paritytech:masterfrom
acatangiu:register-assets-over-bridge
Oct 17, 2024
Merged

[AHs] Support registering assets on Asset Hubs over bridge#5435
acatangiu merged 10 commits into
paritytech:masterfrom
acatangiu:register-assets-over-bridge

Conversation

@acatangiu

Copy link
Copy Markdown
Contributor

Changes

Allows one Asset Hub on one side, to register assets on the other Asset Hub over the bridge.

Rococo <> Ethereum test bridge will be dropped in favor of Westend <> Ethereum test bridge. This PR also changes emulated tests to simulate double bridging from Ethereum<>Westend<>Rococo.

Tests

  • e2e test: Westend Asset Hub can register Westend and Ethereum assets on Asset Hub Rococo
  • e2e test: Rococo Asset Hub can register Rococo assets on Asset Hub Westend
  • e2e test (existing): Users on Ethereum can register Ethereum assets on Asset Hub Westend
  • e2e test: transfer Rococo assets from Rococo to Westend and back
  • e2e test: transfer Westend assets from Westend to Rococo and back
  • e2e test: transfer Ethereum assets (bridged in through Snowbridge) from Westend to Rococo and back

@acatangiu acatangiu added the T10-tests This PR/Issue is related to tests. label Aug 21, 2024
@acatangiu acatangiu self-assigned this Aug 21, 2024
@acatangiu acatangiu enabled auto-merge August 22, 2024 12:57

@franciscoaguirre franciscoaguirre left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@acatangiu acatangiu added the T15-bridges This PR/Issue is related to bridges. label Oct 9, 2024
impl<AssetsAllowedNetworks: Contains<Location>, OriginLocation: Get<Location>>
ContainsPair<Asset, Location> for RemoteAssetFromLocation<AssetsAllowedNetworks, OriginLocation>
impl<
L: TryInto<Location> + Clone,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe xcm::TryAs would also work here:

Suggested change
L: TryInto<Location> + Clone,
L: TryAs<Location>,

so we don't need to clone anything here:

		let Ok(asset) = asset.try_as() else {
			return false;
		};
		let Ok(origin) = origin.try_as() else {
			return false;
		};

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the trait TryAs<cumulus_primitives_core::Location> is not implemented for cumulus_primitives_core::Location, which is required by `RemoteAssetFromLocation<AssetsAllowedNetworks, OriginLocation>: ContainsPair<cumulus_primitives_core::Location, cumulus_primitives_core::Location>

although it should work...

@acatangiu acatangiu added this pull request to the merge queue Oct 14, 2024
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 14, 2024
@acatangiu acatangiu enabled auto-merge October 14, 2024 15:39
@acatangiu acatangiu added this pull request to the merge queue Oct 17, 2024
Merged via the queue into paritytech:master with commit 9714796 Oct 17, 2024
@acatangiu acatangiu deleted the register-assets-over-bridge branch October 17, 2024 13:59
@paritytech-cmd-bot-polkadot-sdk

Copy link
Copy Markdown
Contributor

Created backport PR for stable2407:

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin backport-5435-to-stable2407
git worktree add --checkout .worktree/backport-5435-to-stable2407 backport-5435-to-stable2407
cd .worktree/backport-5435-to-stable2407
git reset --hard HEAD^
git cherry-pick -x 9714796ba9544f98c0361be466b9d993056aad50
git push --force-with-lease

github-actions Bot pushed a commit that referenced this pull request Nov 20, 2024
## Changes

Allows one Asset Hub on one side, to register assets on the other Asset
Hub over the bridge.

Rococo <> Ethereum test bridge will be dropped in favor of Westend <>
Ethereum test bridge. This PR also changes emulated tests to simulate
double bridging from Ethereum<>Westend<>Rococo.

## Tests

- [x] e2e test: Westend Asset Hub can register Westend and Ethereum
assets on Asset Hub Rococo
- [x] e2e test: Rococo Asset Hub can register Rococo assets on Asset Hub
Westend
- [x] e2e test (existing): Users on Ethereum can register Ethereum
assets on Asset Hub Westend
- [x] e2e test: transfer Rococo assets from Rococo to Westend and back
- [x] e2e test: transfer Westend assets from Westend to Rococo and back
- [x] e2e test: transfer Ethereum assets (bridged in through Snowbridge)
from Westend to Rococo and back

(cherry picked from commit 9714796)
@paritytech-cmd-bot-polkadot-sdk

Copy link
Copy Markdown
Contributor

Successfully created backport PR for stable2409:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T10-tests This PR/Issue is related to tests. T15-bridges This PR/Issue is related to bridges.

Projects

Status: Done
Status: Done
Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants