diff --git a/nodes/parachain/src/chain_spec/polimec_paseo.rs b/nodes/parachain/src/chain_spec/polimec_paseo.rs index a01f6d2a5..7cca99099 100644 --- a/nodes/parachain/src/chain_spec/polimec_paseo.rs +++ b/nodes/parachain/src/chain_spec/polimec_paseo.rs @@ -74,7 +74,7 @@ pub fn get_live_chain_spec() -> GenericChainSpec { }; GenericChainSpec::builder( - politest_runtime::WASM_BINARY.expect("WASM binary was not built, please build it!"), + polimec_runtime::WASM_BINARY.expect("WASM binary was not built, please build it!"), Extensions { relay_chain: "paseo".into(), para_id: genesis_config_params.id.into() }, ) .with_name("Polimec Paseo") diff --git a/pallets/funding/src/functions/7_ct_migration.rs b/pallets/funding/src/functions/7_ct_migration.rs index 9c2134110..240c6340c 100644 --- a/pallets/funding/src/functions/7_ct_migration.rs +++ b/pallets/funding/src/functions/7_ct_migration.rs @@ -24,6 +24,9 @@ impl Pallet { Ok(()) } + /// Handle the channel open request from the relay on behalf of a parachain. + /// If the parachain id belongs to a funded project with the same project id, then send an acceptance message and a request for a + /// channel in the opposite direction to the relay. pub fn do_handle_channel_open_request(message: Instruction) -> XcmResult { // TODO: set these constants with a proper value const EXECUTION_DOT: MultiAsset = MultiAsset { @@ -115,6 +118,8 @@ impl Pallet { } } + /// Handle the channel accepted message of project->Polimec from the relay on behalf of the project parachain. + /// Start the migration readiness check for the project. pub fn do_handle_channel_accepted(message: Instruction) -> XcmResult { match message { Instruction::HrmpChannelAccepted { recipient } => { @@ -146,6 +151,8 @@ impl Pallet { } } + /// After the bidirectional HRMP channels are established, check that the project chain has the Polimec receiver pallet, + /// and has minted the amount of CTs sold to the Polimec sovereign account. #[transactional] pub fn do_start_migration_readiness_check(caller: &AccountIdOf, project_id: ProjectId) -> DispatchResult { // * Get variables * @@ -237,6 +244,7 @@ impl Pallet { Ok(()) } + /// Handle the migration readiness check response from the project chain. #[transactional] pub fn do_migration_check_response( location: MultiLocation, @@ -326,6 +334,9 @@ impl Pallet { Ok(()) } + /// Migrate all the CTs of a project for a single participant + /// This entails transferring the funds from the Polimec sovereign account to the participant account, and applying + /// a vesting schedule if necessary. #[transactional] pub fn do_migrate_one_participant(project_id: ProjectId, participant: AccountIdOf) -> DispatchResult { // * Get variables * @@ -370,6 +381,7 @@ impl Pallet { Ok(()) } + /// Mark the migration item that corresponds to a single participation as confirmed or failed. #[transactional] pub fn do_confirm_migrations(location: MultiLocation, query_id: QueryId, response: Response) -> DispatchResult { use xcm::v3::prelude::*; @@ -382,6 +394,7 @@ impl Pallet { Error::::WrongParaId ); + let status = match response { Response::DispatchResult(MaybeErrorCode::Success) => { Self::change_migration_status(project_id, participant.clone(), MigrationStatus::Confirmed)?; diff --git a/runtimes/polimec/Cargo.toml b/runtimes/polimec/Cargo.toml index 3da246c72..3c2414031 100644 --- a/runtimes/polimec/Cargo.toml +++ b/runtimes/polimec/Cargo.toml @@ -279,5 +279,5 @@ try-runtime = [ on-chain-release-build = [ "sp-api/disable-logging" ] development-settings = [ - "shared-configuration/development-settings" + "shared-configuration/development-settings", ] diff --git a/scripts/chopsticks/assethub-transfers/polkadot-polimec.yml b/scripts/chopsticks/assethub-transfers/polkadot-polimec.yml index fea8eaeaa..aeaee4fd0 100644 --- a/scripts/chopsticks/assethub-transfers/polkadot-polimec.yml +++ b/scripts/chopsticks/assethub-transfers/polkadot-polimec.yml @@ -13,79 +13,3 @@ import-storage: { providers: 1, data: { free: "10000000000000000" } }, ], ] - # This will be deleted once Polimec has all funding assets registered in ForeignAssets pallet - ForeignAssets: - Asset: - [ - [ - [1984], - { - owner: "0xba143e2096e073cb9cddc78e6f4969d8a02160d716a69e08214caf5339d88c42", - issuer: "0xba143e2096e073cb9cddc78e6f4969d8a02160d716a69e08214caf5339d88c42", - admin: "0xba143e2096e073cb9cddc78e6f4969d8a02160d716a69e08214caf5339d88c42", - freezer: "0xba143e2096e073cb9cddc78e6f4969d8a02160d716a69e08214caf5339d88c42", - supply: 1000000000, - deposit: 10, - minBalance: 10, - isSufficient: false, - accounts: 1, - sufficients: 1, - approvals: 0, - status: Live, - }, - ], - [ - [10], - { - owner: "0xba143e2096e073cb9cddc78e6f4969d8a02160d716a69e08214caf5339d88c42", - issuer: "0xba143e2096e073cb9cddc78e6f4969d8a02160d716a69e08214caf5339d88c42", - admin: "0xba143e2096e073cb9cddc78e6f4969d8a02160d716a69e08214caf5339d88c42", - freezer: "0xba143e2096e073cb9cddc78e6f4969d8a02160d716a69e08214caf5339d88c42", - supply: 1000000000, - deposit: 10, - minBalance: 10, - isSufficient: false, - accounts: 1, - sufficients: 1, - approvals: 0, - status: Live, - }, - ], - [ - [1337], - { - owner: "0xba143e2096e073cb9cddc78e6f4969d8a02160d716a69e08214caf5339d88c42", - issuer: "0xba143e2096e073cb9cddc78e6f4969d8a02160d716a69e08214caf5339d88c42", - admin: "0xba143e2096e073cb9cddc78e6f4969d8a02160d716a69e08214caf5339d88c42", - freezer: "0xba143e2096e073cb9cddc78e6f4969d8a02160d716a69e08214caf5339d88c42", - supply: 1000000000, - deposit: 10, - minBalance: 10, - isSufficient: false, - accounts: 1, - sufficients: 1, - approvals: 0, - status: Live, - }, - ], - ] - - Metadata: - [ - [[1984], { symbol: "USDT", name: USDT, decimals: 6, isFrozen: false }], - [[10], { symbol: "DOT", name: DOT, decimals: 10, isFrozen: false }], - [[1337], { symbol: "USDC", name: USDC, decimals: 6, isFrozen: false }], - ] - - Account: - [ - [ - [1984, 15CyvMWHKwbAPQ3ekqRFWLyq3kcjU8ypMuuGfsMnxanW85WZ], - { balance: 1000000000 }, - ], - [ - [10, 15CyvMWHKwbAPQ3ekqRFWLyq3kcjU8ypMuuGfsMnxanW85WZ], - { balance: 1000000000 }, - ], - ] -