Skip to content

Commit

Permalink
Merge pull request #571 from galacticcouncil/polkadot-v0.9.29
Browse files Browse the repository at this point in the history
chore: upgrade to polkadot-v0.9.29
  • Loading branch information
mrq1911 authored Nov 3, 2022
2 parents 1a99f62 + 050809f commit c2093c9
Show file tree
Hide file tree
Showing 98 changed files with 2,645 additions and 11,906 deletions.
1,157 changes: 530 additions & 627 deletions Cargo.lock

Large diffs are not rendered by default.

345 changes: 172 additions & 173 deletions Cargo.toml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ coverage:

.PHONY: clippy
clippy:
cargo clippy --release --locked --all-targets --all-features -- -D warnings
cargo clippy --release --locked --all-targets --all-features -- -D warnings -A deprecated

.PHONY: format
format:
Expand Down
151 changes: 73 additions & 78 deletions integration-tests/Cargo.toml

Large diffs are not rendered by default.

154 changes: 74 additions & 80 deletions integration-tests/parachain-runtime-mock/Cargo.toml

Large diffs are not rendered by default.

10 changes: 6 additions & 4 deletions integration-tests/parachain-runtime-mock/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ use polkadot_xcm::prelude::MultiLocation;
use sp_arithmetic::FixedU128;
use sp_runtime::traits::AccountIdConversion;

use polkadot_xcm::latest::Weight as XcmWeight;

use basilisk_runtime::{AdjustmentVariable, MinimumMultiplier, TargetBlockFullness, WeightToFee};

pub const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75);
Expand All @@ -66,22 +68,22 @@ parameter_types! {
pub const ExistentialDeposit: u128 = 500;
pub const MaxReserves: u32 = 50;
pub const RelayNetwork: NetworkId = NetworkId::Kusama;
pub const UnitWeightCost: Weight = 10;
pub const UnitWeightCost: XcmWeight = 10;
pub RelayChainOrigin: Origin = cumulus_pallet_xcm::Origin::Relay.into();
pub const MaxInstructions: u32 = 100;
pub Ancestry: MultiLocation = Parachain(ParachainInfo::parachain_id().into()).into();
pub BlockLength: frame_system::limits::BlockLength =
frame_system::limits::BlockLength::max_with_normal_ratio(5 * 1024 * 1024, NORMAL_DISPATCH_RATIO);
pub const ReservedXcmpWeight: Weight = WEIGHT_PER_SECOND / 4;
pub const ReservedDmpWeight: Weight = WEIGHT_PER_SECOND / 4;
pub const ReservedXcmpWeight: Weight = Weight::from_ref_time(WEIGHT_PER_SECOND.ref_time() / 4);
pub const ReservedDmpWeight: Weight =Weight::from_ref_time(WEIGHT_PER_SECOND.ref_time() / 4);
pub RegistryStringLimit: u32 = 100;
pub const NativeAssetId : AssetId = CORE_ASSET_ID;
pub const TreasuryPalletId: PalletId = PalletId(*b"aca/trsy");
pub ParachainTreasuryAccount: AccountId = TreasuryPalletId::get().into_account_truncating();
pub KsmPerSecond: (AssetId, u128) = (0, 10);
pub BaseRate: u128 = 100;
pub SelfLocation: MultiLocation = MultiLocation::new(1, X1(Parachain(ParachainInfo::parachain_id().into())));
pub const BaseXcmWeight: Weight = 100_000_000;
pub const BaseXcmWeight: XcmWeight = 100_000_000;
pub const MaxAssetsForTransfer: usize = 2;

}
Expand Down
5 changes: 3 additions & 2 deletions integration-tests/src/cross_chain_transfer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use frame_support::{assert_noop, assert_ok};
use polkadot_xcm::{latest::prelude::*, VersionedMultiAssets};

use cumulus_primitives_core::ParaId;
use frame_support::weights::Weight;
use hex_literal::hex;
use orml_traits::currency::MultiCurrency;
use sp_core::H256;
Expand Down Expand Up @@ -300,7 +301,7 @@ fn transfer_from_other_parachain_and_back() {
);
assert_eq!(
basilisk_runtime::Tokens::free_balance(1, &basilisk_runtime::Treasury::account_id()),
35_990_141 // fees should go to treasury
30_905_849 // fees should go to treasury
);
});

Expand Down Expand Up @@ -470,7 +471,7 @@ fn assets_should_be_trapped_when_assets_are_unknown() {
cumulus_pallet_xcmp_queue::Event::Fail {
message_hash: Some(hex!["4efbf4d7ba73f43d5bb4ebbec3189e132ccf2686aed37e97985af019e1cf62dc"].into()),
error: XcmError::AssetNotFound,
weight: 300_000_000,
weight: Weight::from_ref_time(300_000_000),
}
.into(),
pallet_relaychain_info::Event::CurrentBlockNumbers {
Expand Down
12 changes: 6 additions & 6 deletions integration-tests/src/fees.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ fn transaction_fees_should_be_as_expected_when_transfer_happen() {
Basilisk::execute_with(|| {
let diff = UNITS / 100; //0.01

let expected_rust_encoded_fees = 4_556 * UNITS / 100; //45.56
let expected_ui_fees = 4_655 * UNITS / 100; //46.55
let expected_rust_encoded_fees = 4_705 * UNITS / 100; //47.05
let expected_ui_fees = 4_804 * UNITS / 100; //48.04

let call = pallet_currencies::Call::<basilisk_runtime::Runtime>::transfer {
dest: AccountId::from(ALICE),
Expand Down Expand Up @@ -75,8 +75,8 @@ fn transaction_fees_should_be_as_expected_when_nft_is_minted() {
//NOTE: Price showed by polkadotAPPS is changing at second decimal place between runs.
let diff = UNITS / 10; //0.1

let expected_rust_encoded_fees = 41_130 * UNITS / 100; //411.30
let expected_ui_fees = 41_233 * UNITS / 100; //412.33
let expected_rust_encoded_fees = 48_619 * UNITS / 100; //486.19
let expected_ui_fees = 48_724 * UNITS / 100; //487.24

let call = pallet_nft::Call::<basilisk_runtime::Runtime>::mint {
collection_id: 1_000_000,
Expand Down Expand Up @@ -131,8 +131,8 @@ fn transaction_fees_should_be_as_expected_when_nft_collection_is_created() {
//NOTE: Price showed by polkadotAPPS is changing at second decimal place between runs.
let diff = UNITS / 10; //0.1

let expected_rust_encoded_fees = 39_879 * UNITS / 100; //398.79
let expected_ui_fees = 39_982 * UNITS / 100; //399.82
let expected_rust_encoded_fees = 45_584 * UNITS / 100; //455.84
let expected_ui_fees = 45_689 * UNITS / 100; //456.89

let call = pallet_nft::Call::<basilisk_runtime::Runtime>::create_collection {
collection_id: 0,
Expand Down
3 changes: 2 additions & 1 deletion integration-tests/src/kusama_test_net.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ use cumulus_primitives_core::ParaId;
use cumulus_test_relay_sproof_builder::RelayStateSproofBuilder;
use frame_support::assert_ok;
use frame_support::traits::GenesisBuild;
use frame_support::weights::Weight;
use polkadot_primitives::v2::{BlockNumber, MAX_CODE_SIZE, MAX_POV_SIZE};
use polkadot_runtime_parachains::configuration::HostConfiguration;
use pretty_assertions::assert_eq;
Expand Down Expand Up @@ -103,7 +104,7 @@ fn default_parachains_host_configuration() -> HostConfiguration<BlockNumber> {
max_upward_queue_count: 8,
max_upward_queue_size: 1024 * 1024,
max_downward_message_size: 1024,
ump_service_total_weight: 4 * 1_000_000_000,
ump_service_total_weight: Weight::from_ref_time(4 * 1_000_000_000),
max_upward_message_size: 50 * 1024,
max_upward_message_num_per_candidate: 5,
hrmp_sender_deposit: 0,
Expand Down
8 changes: 4 additions & 4 deletions integration-tests/src/non_native_fee.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ fn non_native_fee_payment_works_with_xyk_spot_price() {

let bob_balance = basilisk_runtime::Tokens::free_balance(1, &AccountId::from(BOB));

assert_eq!(bob_balance, 999_999_974_195_044);
assert_eq!(bob_balance, 999_999_979_279_336);

let pair_account = basilisk_runtime::XYK::get_pair_id(AssetPair {
asset_in: currency_0,
Expand Down Expand Up @@ -108,14 +108,14 @@ fn non_native_fee_payment_works_with_xyk_spot_price() {
));

let dave_balance = basilisk_runtime::Tokens::free_balance(1, &AccountId::from(DAVE));
assert_eq!(dave_balance, 968_046_450_495_217);
assert_eq!(dave_balance, 974_342_185_521_892);

expect_basilisk_events(vec![
pallet_transaction_multi_payment::Event::FeeWithdrawn {
account_id: DAVE.into(),
asset_id: 1,
native_fee_amount: 55_738_705_000_000,
non_native_fee_amount: 31_953_549_504_783,
native_fee_amount: 44_756_635_000_000,
non_native_fee_amount: 25_657_814_478_108,
destination_account_id: basilisk_runtime::MultiTransactionPayment::get_fee_receiver(),
}
.into(),
Expand Down
Loading

0 comments on commit c2093c9

Please sign in to comment.