Allow two Parachains to swap (#4772)

* add support for parachain to parachain swap

* enable swaps on kusama

* sanity test in paras_registrar

* express more errors

* finish up tests

* fmt

* make fields pub

* refactor integration tests to use real accounts

* Update Crowdloan Account to FundIndex (#4824)

* update fund account to use index

* fix integration tests

* Update runtime/common/src/crowdloan.rs

* finish parachain swap test

* format

* fix warning

* fix spacing

* fix formatting

* write migrations

* add migration

* fixes

* more fixes to migration

* Update runtime/common/src/crowdloan/mod.rs

Co-authored-by: Zeke Mostov <z.mostov@gmail.com>

* Update runtime/common/src/paras_registrar.rs

* Update migration.rs

* extract swap function

Co-authored-by: Zeke Mostov <z.mostov@gmail.com>
This commit is contained in:
Shawn Tabrizi
2022-02-12 18:16:22 +01:00
committed by GitHub
parent 85f4740591
commit d5f5127354
8 changed files with 811 additions and 247 deletions
+19 -1
View File
@@ -1084,11 +1084,29 @@ pub type Executive = frame_executive::Executive<
frame_system::ChainContext<Runtime>,
Runtime,
AllPalletsWithSystem,
(SessionHistoricalPalletPrefixMigration, SchedulerMigrationV3),
(SessionHistoricalPalletPrefixMigration, SchedulerMigrationV3, CrowdloanIndexMigration),
>;
/// The payload being signed in transactions.
pub type SignedPayload = generic::SignedPayload<Call, SignedExtra>;
// Migration for crowdloan pallet to use fund index for account generation.
pub struct CrowdloanIndexMigration;
impl OnRuntimeUpgrade for CrowdloanIndexMigration {
fn on_runtime_upgrade() -> frame_support::weights::Weight {
crowdloan::migration::crowdloan_index_migration::migrate::<Runtime>()
}
#[cfg(feature = "try-runtime")]
fn pre_upgrade() -> Result<(), &'static str> {
crowdloan::migration::crowdloan_index_migration::pre_migrate::<Runtime>()
}
#[cfg(feature = "try-runtime")]
fn post_upgrade() -> Result<(), &'static str> {
crowdloan::migration::crowdloan_index_migration::post_migrate::<Runtime>()
}
}
// Migration for scheduler pallet to move from a plain Call to a CallOrHash.
pub struct SchedulerMigrationV3;