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

Add XcmPaymentApi and DryRunApi to all runtimes #380

Merged
Merged
Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
d4570a0
feat(xcm): add XcmPaymentApi and DryRunApi to all runtimes
franciscoaguirre Jun 25, 2024
c44c69f
fix: fmt
franciscoaguirre Jul 12, 2024
2e748fb
feat(coretime-kusama-runtime): add XcmPaymentApi and DryRunApi
franciscoaguirre Jun 26, 2024
ee2e870
fix: fmt
franciscoaguirre Jul 12, 2024
555eb1a
fix(encointer): AssetId -> XcmAssetId
franciscoaguirre Jul 12, 2024
f1cf7f9
feat(xcm-fee-payment-runtime-api): update Cargo.lock
franciscoaguirre Jul 12, 2024
7d867b5
fix(kusama-runtime): feature propagation
franciscoaguirre Jul 12, 2024
6b05e7d
doc: update CHANGELOG
franciscoaguirre Jun 25, 2024
5e3e2db
doc: update CHANGELOG
franciscoaguirre Jul 12, 2024
138c5cc
test(asset-hub-polkadot): add XCM fee estimation test (not working)
franciscoaguirre Jul 12, 2024
5fbe49a
fix(asset-hub-polkadot-integration-tests): reverse order A -> B to B …
franciscoaguirre Jul 15, 2024
57df088
fix: fmt
franciscoaguirre Jul 15, 2024
d464252
feat(asset-hub-kusama-integration-tests): add test for XCM fee estima…
franciscoaguirre Jul 15, 2024
4a53b10
chore: address feedback
franciscoaguirre Jul 15, 2024
1c215b1
feat(integration-tests-helpers): use XCM runtime apis to estimate del…
franciscoaguirre Jul 15, 2024
7a2fd64
feat(integration-tests-helpers): use XCM runtime apis to estimate del…
franciscoaguirre Jul 15, 2024
5aa919a
fix: fmt
franciscoaguirre Jul 15, 2024
181b9d4
feat(people): add delivery fees
franciscoaguirre Jul 16, 2024
e59f4a1
feat(people-kusama-integration-tests): teleport tests with delivery fees
franciscoaguirre Jul 16, 2024
708aa26
revert(people): delivery fees
franciscoaguirre Jul 16, 2024
0d1794c
fix: fmt
franciscoaguirre Jul 16, 2024
92ff22c
feat(people-polkadot): teleport test with delivery fees
franciscoaguirre Jul 16, 2024
ffc6c1b
feat(coretime-kusama-integration-tests): initial setup and test
franciscoaguirre Jul 16, 2024
c1cc4c3
fix: fmt
franciscoaguirre Jul 16, 2024
59ed358
feat(bridge-hub-kusama-integration-tests): teleport test with deliver…
franciscoaguirre Jul 16, 2024
9b22b37
feat(bridge-hub-polkadot-integration-tests): add teleport test with d…
franciscoaguirre Jul 16, 2024
55b5191
WIP
franciscoaguirre Jul 17, 2024
5068ea7
Merge branch 'main' into xcm-runtime-apis
franciscoaguirre Jul 22, 2024
79a8340
Merge branch 'xcm-runtime-apis' of github.com:franciscoaguirre/polkad…
franciscoaguirre Jul 22, 2024
899dcd7
fix: fmt
franciscoaguirre Jul 22, 2024
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

### Added

- All runtimes: XcmPaymentApi and DryRunApi ([polkadot-fellows/runtimes#380](https://github.com/polkadot-fellows/runtimes/pull/380))

#### From [#322](https://github.com/polkadot-fellows/runtimes/pull/322):

- Add `claim_assets` extrinsic to `pallet-xcm` ([SDK v1.9 #3403](https://github.com/paritytech/polkadot-sdk/pull/3403)).
Expand Down
59 changes: 59 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ codec = { package = "parity-scale-codec", version = "3.6.9", default-features =
collectives-polkadot-emulated-chain = { path = "integration-tests/emulated/chains/parachains/collectives/collectives-polkadot" }
collectives-polkadot-runtime = { path = "system-parachains/collectives/collectives-polkadot" }
collectives-polkadot-runtime-constants = { path = "system-parachains/collectives/collectives-polkadot/constants" }
coretime-kusama-emulated-chain = { path = "integration-tests/emulated/chains/parachains/coretime/coretime-kusama" }
coretime-kusama-runtime = { path = "system-parachains/coretime/coretime-kusama" }
cumulus-pallet-aura-ext = { version = "0.14.0", default-features = false }
cumulus-pallet-dmp-queue = { version = "0.14.0", default-features = false }
Expand Down Expand Up @@ -235,6 +236,7 @@ xcm = { version = "14.0.0", default-features = false, package = "staging-xcm" }
xcm-builder = { version = "14.0.0", default-features = false, package = "staging-xcm-builder" }
xcm-emulator = { version = "0.12.0" }
xcm-executor = { version = "14.0.0", default-features = false, package = "staging-xcm-executor" }
xcm-fee-payment-runtime-api = { version = "0.4.0", default-features = false }
anyhow = { version = "1.0.82" }
subxt = { version = "0.35.0", default-features = false }
tracing-subscriber = { version = "0.3.18" }
Expand All @@ -251,6 +253,7 @@ members = [
"integration-tests/emulated/chains/parachains/bridges/bridge-hub-kusama",
"integration-tests/emulated/chains/parachains/bridges/bridge-hub-polkadot",
"integration-tests/emulated/chains/parachains/collectives/collectives-polkadot",
"integration-tests/emulated/chains/parachains/coretime/coretime-kusama",
"integration-tests/emulated/chains/parachains/people/people-kusama",
"integration-tests/emulated/chains/parachains/people/people-polkadot",
"integration-tests/emulated/chains/parachains/testing/penpal",
Expand All @@ -265,6 +268,7 @@ members = [
"integration-tests/emulated/tests/bridges/bridge-hub-kusama",
"integration-tests/emulated/tests/bridges/bridge-hub-polkadot",
"integration-tests/emulated/tests/collectives/collectives-polkadot",
"integration-tests/emulated/tests/coretime/coretime-kusama",
"integration-tests/emulated/tests/people/people-kusama",
"integration-tests/emulated/tests/people/people-polkadot",
"relay/kusama",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[package]
name = "coretime-kusama-emulated-chain"
version = "0.0.0"
authors.workspace = true
edition.workspace = true
license = "Apache-2.0"
description = "Coretime Kusama emulated chain used for integration tests"
publish = false

[dependencies]

# Substrate
sp-core = { workspace = true, default-features = true }
frame-support = { workspace = true, default-features = true }

# Cumulus
parachains-common = { workspace = true, default-features = true }
cumulus-primitives-core = { workspace = true, default-features = true }
emulated-integration-tests-common = { workspace = true }

# Runtimes
coretime-kusama-runtime = { workspace = true }
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
// 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.

// Substrate
use sp_core::storage::Storage;

// Cumulus
use emulated_integration_tests_common::{
accounts, build_genesis_storage, collators, SAFE_XCM_VERSION,
};
use parachains_common::Balance;

pub const PARA_ID: u32 = 1001;
pub const ED: Balance = coretime_kusama_runtime::ExistentialDeposit::get();

pub fn genesis() -> Storage {
let genesis_config = coretime_kusama_runtime::RuntimeGenesisConfig {
system: coretime_kusama_runtime::SystemConfig::default(),
balances: coretime_kusama_runtime::BalancesConfig {
balances: accounts::init_balances().iter().cloned().map(|k| (k, ED * 4096)).collect(),
},
parachain_info: coretime_kusama_runtime::ParachainInfoConfig {
parachain_id: PARA_ID.into(),
..Default::default()
},
collator_selection: coretime_kusama_runtime::CollatorSelectionConfig {
invulnerables: collators::invulnerables().iter().cloned().map(|(acc, _)| acc).collect(),
candidacy_bond: ED * 16,
..Default::default()
},
session: coretime_kusama_runtime::SessionConfig {
keys: collators::invulnerables()
.into_iter()
.map(|(acc, aura)| {
(
acc.clone(), // account id
acc, // validator id
coretime_kusama_runtime::SessionKeys { aura }, // session keys
)
})
.collect(),
},
polkadot_xcm: coretime_kusama_runtime::PolkadotXcmConfig {
safe_xcm_version: Some(SAFE_XCM_VERSION),
..Default::default()
},
..Default::default()
};

build_genesis_storage(
&genesis_config,
coretime_kusama_runtime::WASM_BINARY.expect("WASM binary was not built, please build it!"),
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
// 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.

pub mod genesis;

// Substrate
use frame_support::traits::OnInitialize;

// Cumulus
use emulated_integration_tests_common::{
impl_accounts_helpers_for_parachain, impl_assert_events_helpers_for_parachain,
impls::Parachain, xcm_emulator::decl_test_parachains,
};

// CollectivesPolkadot Parachain declaration
decl_test_parachains! {
pub struct CoretimeKusama {
genesis = genesis::genesis(),
on_init = {
coretime_kusama_runtime::AuraExt::on_initialize(1);
},
runtime = coretime_kusama_runtime,
core = {
XcmpMessageHandler: coretime_kusama_runtime::XcmpQueue,
LocationToAccountId: coretime_kusama_runtime::xcm_config::LocationToAccountId,
ParachainInfo: coretime_kusama_runtime::ParachainInfo,
MessageOrigin: cumulus_primitives_core::AggregateMessageOrigin,
},
pallets = {
PolkadotXcm: coretime_kusama_runtime::PolkadotXcm,
Balances: coretime_kusama_runtime::Balances,
}
},
}

// CoretimeKusama implementation
impl_accounts_helpers_for_parachain!(CoretimeKusama);
impl_assert_events_helpers_for_parachain!(CoretimeKusama);
Loading
Loading