Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
42 changes: 21 additions & 21 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
8 changes: 5 additions & 3 deletions integration-tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -151,13 +149,16 @@ 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",
"xcm/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",
Expand Down Expand Up @@ -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",
]

4 changes: 2 additions & 2 deletions integration-tests/src/tests/evaluator_slash_sideffects.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<PolimecRuntime>::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::<PolimecRuntime>::get(&alice.clone()).data;
assert_eq!(
Expand Down
28 changes: 10 additions & 18 deletions integration-tests/src/tests/transact.rs
Original file line number Diff line number Diff line change
@@ -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 {
Expand All @@ -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 {
Expand Down Expand Up @@ -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 = <AssetHubRuntime as frame_system::Config>::Hashing::hash(&MESSAGE);

Expand All @@ -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");
});
}
1 change: 1 addition & 0 deletions pallets/funding/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
2 changes: 1 addition & 1 deletion pallets/funding/src/functions/3_auction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ impl<T: Config> Pallet<T> {
};

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::<T>::insert(project_id, bid_id, &new_bid);
NextBidId::<T>::set(bid_id.saturating_add(One::one()));
Expand Down
7 changes: 7 additions & 0 deletions pallets/on-slash-vesting/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
6 changes: 3 additions & 3 deletions runtimes/polimec/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};

Expand Down Expand Up @@ -906,7 +906,7 @@ where
let signature = raw_payload.using_encoded(|payload| C::sign(payload, public))?;
let (call, extra, _) = raw_payload.deconstruct();
let address = <Runtime as frame_system::Config>::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)
}
Expand Down
4 changes: 2 additions & 2 deletions runtimes/polimec/src/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ pub type Barrier = TrailingSetTopicAsId<
DenyReserveTransferToRelayChain,
(
TakeWeightCredit,
// Allow DescendOrigin(AccountId32) from Asset Hub
AllowPaidDescendFromAssetHub,
// Expected responses are OK.
AllowKnownQueryResponses<PolkadotXcm>,
Expand Down Expand Up @@ -371,7 +372,6 @@ pub type XcmRouter = (

impl pallet_xcm::Config for Runtime {
type AdminOrigin = EnsureRoot<AccountId>;
// ^ Override for AdvertisedXcmVersion default
type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion;
type Currency = Balances;
type CurrencyMatcher = ();
Expand All @@ -391,7 +391,7 @@ impl pallet_xcm::Config for Runtime {
type WeightInfo = crate::weights::pallet_xcm::WeightInfo<Runtime>;
type XcmExecuteFilter = Everything;
type XcmExecutor = XcmExecutor<XcmConfig>;
// 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.
Expand Down