diff --git a/Cargo.lock b/Cargo.lock index 361b932fc..32ef998b7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5346,7 +5346,7 @@ dependencies = [ [[package]] name = "integration-tests" -version = "1.0.0" +version = "1.1.0" dependencies = [ "asset-hub-westend-runtime", "assets-common", @@ -5367,9 +5367,9 @@ dependencies = [ "pallet-aura", "pallet-balances", "pallet-collective", - "pallet-democracy 1.0.0", + "pallet-democracy 1.1.0", "pallet-dispenser", - "pallet-elections-phragmen 1.0.0", + "pallet-elections-phragmen 1.1.0", "pallet-funding", "pallet-im-online", "pallet-linear-release", @@ -7039,7 +7039,7 @@ dependencies = [ [[package]] name = "macros" -version = "1.0.0" +version = "1.1.0" dependencies = [ "quote", "sp-core", @@ -7048,7 +7048,7 @@ dependencies = [ [[package]] name = "macros-tests" -version = "1.0.0" +version = "1.1.0" dependencies = [ "macros", ] @@ -7798,7 +7798,7 @@ dependencies = [ [[package]] name = "on-slash-vesting" -version = "1.0.0" +version = "1.1.0" dependencies = [ "frame-support", "frame-system", @@ -8412,7 +8412,7 @@ dependencies = [ [[package]] name = "pallet-democracy" -version = "1.0.0" +version = "1.1.0" dependencies = [ "frame-benchmarking", "frame-support", @@ -8447,7 +8447,7 @@ dependencies = [ [[package]] name = "pallet-dispenser" -version = "1.0.0" +version = "1.1.0" dependencies = [ "frame-benchmarking", "frame-support", @@ -8502,7 +8502,7 @@ dependencies = [ [[package]] name = "pallet-elections-phragmen" -version = "1.0.0" +version = "1.1.0" dependencies = [ "frame-benchmarking", "frame-support", @@ -8558,7 +8558,7 @@ dependencies = [ [[package]] name = "pallet-funding" -version = "1.0.0" +version = "1.1.0" dependencies = [ "cumulus-pallet-parachain-system", "cumulus-primitives-core", @@ -8671,7 +8671,7 @@ dependencies = [ [[package]] name = "pallet-linear-release" -version = "1.0.0" +version = "1.1.0" dependencies = [ "frame-benchmarking", "frame-support", @@ -8927,7 +8927,7 @@ dependencies = [ [[package]] name = "pallet-oracle-ocw" -version = "1.0.0" +version = "1.1.0" dependencies = [ "frame-support", "frame-system", @@ -8951,7 +8951,7 @@ dependencies = [ [[package]] name = "pallet-parachain-staking" -version = "1.0.0" +version = "1.1.0" dependencies = [ "frame-benchmarking", "frame-support", @@ -9022,7 +9022,7 @@ dependencies = [ [[package]] name = "pallet-proxy-bonding" -version = "1.0.0" +version = "1.1.0" dependencies = [ "frame-benchmarking", "frame-support", @@ -9918,7 +9918,7 @@ checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" [[package]] name = "polimec-common" -version = "1.0.0" +version = "1.1.0" dependencies = [ "frame-benchmarking", "frame-support", @@ -9935,7 +9935,7 @@ dependencies = [ [[package]] name = "polimec-common-test-utils" -version = "1.0.0" +version = "1.1.0" dependencies = [ "chrono", "frame-support", @@ -9949,7 +9949,7 @@ dependencies = [ [[package]] name = "polimec-node" -version = "1.0.0" +version = "1.1.0" dependencies = [ "clap", "color-print", @@ -10008,7 +10008,7 @@ dependencies = [ [[package]] name = "polimec-runtime" -version = "1.0.0" +version = "1.1.0" dependencies = [ "assets-common", "cumulus-pallet-aura-ext", @@ -10037,9 +10037,9 @@ dependencies = [ "pallet-authorship", "pallet-balances", "pallet-collective", - "pallet-democracy 1.0.0", + "pallet-democracy 1.1.0", "pallet-dispenser", - "pallet-elections-phragmen 1.0.0", + "pallet-elections-phragmen 1.1.0", "pallet-funding", "pallet-linear-release", "pallet-membership", @@ -14624,7 +14624,7 @@ dependencies = [ [[package]] name = "shared-configuration" -version = "1.0.0" +version = "1.1.0" dependencies = [ "cumulus-primitives-core", "frame-support", diff --git a/Cargo.toml b/Cargo.toml index 80f958698..937db5b1d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,7 +31,7 @@ homepage = "https://www.polimec.org/" license-file = "LICENSE" readme = "README.md" repository = "https://github.com/Polimec/polimec-node" -version = "1.0.0" +version = "1.1.0" [profile.release] # Substrate runtime requires unwinding. diff --git a/integration-tests/Cargo.toml b/integration-tests/Cargo.toml index d9aef2c97..5d7627883 100644 --- a/integration-tests/Cargo.toml +++ b/integration-tests/Cargo.toml @@ -139,8 +139,6 @@ std = [ "polkadot-parachain-primitives/std", "polkadot-primitives/std", "polkadot-runtime-parachains/std", - "westend-runtime-constants/std", - "westend-runtime/std", "scale-info/std", "serde/std", "sp-arithmetic/std", @@ -151,6 +149,8 @@ std = [ "sp-core/std", "sp-io/std", "sp-runtime/std", + "westend-runtime-constants/std", + "westend-runtime/std", "xcm-builder/std", "xcm-executor/std", "xcm-runtime-apis/std", @@ -158,6 +158,7 @@ std = [ ] development-settings = [ "polimec-runtime/development-settings" ] runtime-benchmarks = [ + "asset-hub-westend-runtime/runtime-benchmarks", "assets-common/runtime-benchmarks", "cumulus-pallet-parachain-system/runtime-benchmarks", "cumulus-primitives-core/runtime-benchmarks", @@ -193,9 +194,10 @@ runtime-benchmarks = [ "polkadot-primitives/runtime-benchmarks", "polkadot-runtime-parachains/runtime-benchmarks", "polkadot-service/runtime-benchmarks", - "westend-runtime/runtime-benchmarks", "sp-runtime/runtime-benchmarks", + "westend-runtime/runtime-benchmarks", "xcm-builder/runtime-benchmarks", "xcm-executor/runtime-benchmarks", "xcm-runtime-apis/runtime-benchmarks", ] + diff --git a/integration-tests/src/tests/evaluator_slash_sideffects.rs b/integration-tests/src/tests/evaluator_slash_sideffects.rs index 28ffe05bc..f1b0e18da 100644 --- a/integration-tests/src/tests/evaluator_slash_sideffects.rs +++ b/integration-tests/src/tests/evaluator_slash_sideffects.rs @@ -116,11 +116,11 @@ fn evaluator_slash_reduces_vesting_schedules() { assert_eq!(ProjectStatus::FundingFailed, inst.go_to_next_state(project_id)); assert_eq!(ProjectStatus::SettlementStarted(FundingOutcome::Failure), inst.go_to_next_state(project_id)); - const END_BLOCK: u32 = 18; + const END_BLOCK: u32 = 19; assert_eq!(inst.current_block(), BlockNumberFor::::from(END_BLOCK)); // All schedules start at block 5, and funding ended at block 18 - const TIME_PASSED: u128 = 13u128; + const TIME_PASSED: u128 = 14u128; let alice_account_data = Account::::get(&alice.clone()).data; assert_eq!( diff --git a/integration-tests/src/tests/transact.rs b/integration-tests/src/tests/transact.rs index 6729ce702..84a418437 100644 --- a/integration-tests/src/tests/transact.rs +++ b/integration-tests/src/tests/transact.rs @@ -1,13 +1,10 @@ -extern crate alloc; -use alloc::sync::Arc; - use crate::{ asset_hub, polimec, AssetHubEvent, AssetHubOrigin, AssetHubRuntime, AssetHubWestendNet, AssetHubXcmPallet, PolimecAccountId, PolimecEvent, PolimecNet, PolimecRuntime, ALICE, -}; // Make sure ALICE and BOB are pub in accounts +}; use parity_scale_codec::Encode; use sp_runtime::traits::Hash; -use xcm::{v4::prelude::*, DoubleEncoded}; +use xcm::{v4::prelude::*, DoubleEncoded, VersionedLocation, VersionedXcm}; use xcm_emulator::{Chain, ConvertLocation, TestExt}; fn polimec_location() -> Location { @@ -28,14 +25,10 @@ fn transact_from_asset_hub_to_polimec_works() { AssetHubXcmPallet::send( AssetHubOrigin::signed(AssetHubWestendNet::account_id_of(ALICE)), - Box::new(xcm::VersionedLocation::V4(polimec_location())), - Box::new(xcm::VersionedXcm::V4(Xcm(vec![ + Box::new(VersionedLocation::V4(polimec_location())), + Box::new(VersionedXcm::V4(Xcm(vec![ Instruction::BuyExecution { - fees: Asset { - id: Location { parents: 1, interior: Here.into() }.into(), - fun: Fungibility::Fungible(1_000_000_000), - } - .into(), + fees: Asset { id: Location::parent().into(), fun: Fungibility::Fungible(1_000_000_000) }.into(), weight_limit: WeightLimit::Unlimited, }, Instruction::Transact { @@ -66,12 +59,11 @@ fn transact_from_asset_hub_to_polimec_works() { let sender_sovereign_account: PolimecAccountId = polimec_runtime::xcm_config::LocationToAccountId::convert_location(&Location { parents: 1, - interior: Junctions::X2(Arc::new([ - Parachain(asset_hub::PARA_ID), - AccountId32 { network: None, id: alice_westend.encode()[..].try_into().unwrap() }, - ])), + interior: Junctions::X2( + [Parachain(asset_hub::PARA_ID), AccountId32 { network: None, id: alice_westend.into() }].into(), + ), }) - .expect("Failed to convert location to account id"); + .expect("Failed to convert Location to AccountId32"); let expected_hash = ::Hashing::hash(&MESSAGE); @@ -84,6 +76,6 @@ fn transact_from_asset_hub_to_polimec_works() { ) }); - assert!(contains_remark, "Expected a remark event in PolimecNet events"); + assert!(contains_remark, "Expected a remark event in Polimec events"); }); } diff --git a/pallets/funding/Cargo.toml b/pallets/funding/Cargo.toml index 3aabe4610..cafccfa75 100644 --- a/pallets/funding/Cargo.toml +++ b/pallets/funding/Cargo.toml @@ -128,5 +128,6 @@ try-runtime = [ "polimec-common-test-utils?/try-runtime", "polimec-common/try-runtime", "sp-runtime/try-runtime", + "on-slash-vesting/try-runtime" ] on-chain-release-build = [] diff --git a/pallets/funding/src/functions/3_auction.rs b/pallets/funding/src/functions/3_auction.rs index 2c6770536..8dc3178e5 100644 --- a/pallets/funding/src/functions/3_auction.rs +++ b/pallets/funding/src/functions/3_auction.rs @@ -175,7 +175,7 @@ impl Pallet { }; Self::bond_plmc_with_mode(&bidder, project_id, plmc_bond, mode, funding_asset)?; - Self::try_funding_asset_hold(&bidder, project_id, funding_asset_amount_locked, funding_asset.id().into())?; + Self::try_funding_asset_hold(&bidder, project_id, funding_asset_amount_locked, funding_asset.id())?; Bids::::insert(project_id, bid_id, &new_bid); NextBidId::::set(bid_id.saturating_add(One::one())); diff --git a/pallets/on-slash-vesting/Cargo.toml b/pallets/on-slash-vesting/Cargo.toml index 927207617..9c9b18fbf 100644 --- a/pallets/on-slash-vesting/Cargo.toml +++ b/pallets/on-slash-vesting/Cargo.toml @@ -47,3 +47,10 @@ runtime-benchmarks = [ "pallet-vesting/runtime-benchmarks", "sp-runtime/runtime-benchmarks", ] +try-runtime = [ + "frame-support/try-runtime", + "frame-system/try-runtime", + "pallet-balances/try-runtime", + "pallet-vesting/try-runtime", + "sp-runtime/try-runtime" +] diff --git a/runtimes/polimec/src/lib.rs b/runtimes/polimec/src/lib.rs index 3e931575c..06d1a448e 100644 --- a/runtimes/polimec/src/lib.rs +++ b/runtimes/polimec/src/lib.rs @@ -242,10 +242,10 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: Cow::Borrowed("polimec-mainnet"), impl_name: Cow::Borrowed("polimec-mainnet"), authoring_version: 1, - spec_version: 1_000_000, + spec_version: 1_001_000, impl_version: 0, apis: RUNTIME_API_VERSIONS, - transaction_version: 7, + transaction_version: 8, system_version: 1, }; @@ -906,7 +906,7 @@ where let signature = raw_payload.using_encoded(|payload| C::sign(payload, public))?; let (call, extra, _) = raw_payload.deconstruct(); let address = ::Lookup::unlookup(account); - let transaction = generic::UncheckedExtrinsic::new_signed(call, address, signature, extra).into(); + let transaction = generic::UncheckedExtrinsic::new_signed(call, address, signature, extra); Some(transaction) } diff --git a/runtimes/polimec/src/xcm_config.rs b/runtimes/polimec/src/xcm_config.rs index 45c922209..4cacb5c3b 100644 --- a/runtimes/polimec/src/xcm_config.rs +++ b/runtimes/polimec/src/xcm_config.rs @@ -266,6 +266,7 @@ pub type Barrier = TrailingSetTopicAsId< DenyReserveTransferToRelayChain, ( TakeWeightCredit, + // Allow DescendOrigin(AccountId32) from Asset Hub AllowPaidDescendFromAssetHub, // Expected responses are OK. AllowKnownQueryResponses, @@ -371,7 +372,6 @@ pub type XcmRouter = ( impl pallet_xcm::Config for Runtime { type AdminOrigin = EnsureRoot; - // ^ Override for AdvertisedXcmVersion default type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion; type Currency = Balances; type CurrencyMatcher = (); @@ -391,7 +391,7 @@ impl pallet_xcm::Config for Runtime { type WeightInfo = crate::weights::pallet_xcm::WeightInfo; type XcmExecuteFilter = Everything; type XcmExecutor = XcmExecutor; - // We only allow reserve based transfers of AssetHub reserve assets back to AssetHub. + // We only allow reserve based transfers of Asset Hub reserve assets back to Asset Hub. type XcmReserveTransferFilter = AssetHubAssetsAsReserve; type XcmRouter = XcmRouter; // We allow teleportation of PLMC to Polkadot Asset Hub.