forked from polkadot-fellows/runtimes
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add pallet-xcm patch with
claim_assets
extrinsic (#7)
* feat(pallet-xcm): bump version * feat(claim_assets): add a test for claim_assets in all runtimes * fix(pallet_xcm::benchmarking): add missing get_asset function to runtimes * fix: fmt * chore: move claim_asset tests to their own file under each runtime * chore(claim_assets): add weights * feat(claim_assets): more test cases * fix: fmt
- Loading branch information
1 parent
ab960bc
commit 21fd3d1
Showing
41 changed files
with
360 additions
and
35 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
integration-tests/emulated/tests/assets/asset-hub-kusama/src/tests/claim_assets.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Copyright (C) Parity Technologies (UK) Ltd. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
//! Tests related to claiming assets trapped during XCM execution. | ||
use crate::*; | ||
|
||
use asset_hub_kusama_runtime::ExistentialDeposit; | ||
use integration_tests_helpers::test_chain_can_claim_assets; | ||
use xcm_executor::traits::DropAssets; | ||
|
||
#[test] | ||
fn assets_can_be_claimed() { | ||
let amount = ExistentialDeposit::get(); | ||
let assets: Assets = (Parent, amount).into(); | ||
|
||
test_chain_can_claim_assets!(AssetHubKusama, RuntimeCall, NetworkId::Kusama, assets, amount); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/claim_assets.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// Copyright (C) Parity Technologies (UK) Ltd. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
//! Tests related to claiming assets trapped during XCM execution. | ||
use crate::*; | ||
|
||
use asset_hub_polkadot_runtime::ExistentialDeposit; | ||
use integration_tests_helpers::test_chain_can_claim_assets; | ||
use xcm_executor::traits::DropAssets; | ||
|
||
#[test] | ||
fn assets_can_be_claimed() { | ||
let amount = ExistentialDeposit::get(); | ||
let assets: Assets = (Parent, amount).into(); | ||
|
||
test_chain_can_claim_assets!( | ||
AssetHubPolkadot, | ||
RuntimeCall, | ||
NetworkId::Polkadot, | ||
assets, | ||
amount | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
integration-tests/emulated/tests/bridges/bridge-hub-kusama/src/tests/claim_assets.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Copyright (C) Parity Technologies (UK) Ltd. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
//! Tests related to claiming assets trapped during XCM execution. | ||
use crate::*; | ||
|
||
use bridge_hub_kusama_runtime::ExistentialDeposit; | ||
use integration_tests_helpers::test_chain_can_claim_assets; | ||
use xcm_executor::traits::DropAssets; | ||
|
||
#[test] | ||
fn assets_can_be_claimed() { | ||
let amount = ExistentialDeposit::get(); | ||
let assets: Assets = (Parent, amount).into(); | ||
|
||
test_chain_can_claim_assets!(AssetHubKusama, RuntimeCall, NetworkId::Kusama, assets, amount); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ | |
use crate::*; | ||
|
||
mod asset_transfers; | ||
mod claim_assets; | ||
mod send_xcm; | ||
mod teleport; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
integration-tests/emulated/tests/bridges/bridge-hub-polkadot/src/tests/claim_assets.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// Copyright (C) Parity Technologies (UK) Ltd. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
//! Tests related to claiming assets trapped during XCM execution. | ||
use crate::*; | ||
|
||
use bridge_hub_polkadot_runtime::ExistentialDeposit; | ||
use integration_tests_helpers::test_chain_can_claim_assets; | ||
use xcm_executor::traits::DropAssets; | ||
|
||
#[test] | ||
fn assets_can_be_claimed() { | ||
let amount = ExistentialDeposit::get(); | ||
let assets: Assets = (Parent, amount).into(); | ||
|
||
test_chain_can_claim_assets!( | ||
AssetHubPolkadot, | ||
RuntimeCall, | ||
NetworkId::Polkadot, | ||
assets, | ||
amount | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ | |
use crate::*; | ||
|
||
mod asset_transfers; | ||
mod claim_assets; | ||
mod send_xcm; | ||
mod teleport; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.