Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

💻 Run new benchmarks #352

Merged
merged 1 commit into from
Jul 8, 2024
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
25 changes: 24 additions & 1 deletion integration-tests/src/tests/ct_migration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@
use crate::*;
use frame_support::traits::{fungible::Mutate, fungibles::Inspect};
use itertools::Itertools;
use pallet_funding::{assert_close_enough, types::*, ProjectId};
use pallet_funding::{assert_close_enough, types::*, ProjectId, WeightInfo};
use polimec_common::migration_types::{MigrationStatus, Migrations, ParticipationType};
use polimec_runtime::{Funding, RuntimeOrigin};
use polkadot_service::chain_spec::get_account_id_from_seed;
use sp_runtime::Perquintill;
use std::collections::HashMap;
use tests::defaults::*;
use xcm_executor::traits::WeightBounds;

fn alice() -> AccountId {
get_account_id_from_seed::<sr25519::Public>(ALICE)
Expand Down Expand Up @@ -318,3 +319,25 @@ fn cannot_start_pallet_migration_with_unsettled_participations() {
});
}
}

#[test]
fn hrmp_functions_weight_is_under_assumed_maximum() {
type WeightInfo = <PolimecRuntime as pallet_funding::Config>::WeightInfo;
type XcmWeigher = <polimec_runtime::xcm_config::XcmConfig as polimec_xcm_executor::Config>::Weigher;

let open_channel_message = xcm::v3::Instruction::<PolimecCall>::HrmpNewChannelOpenRequest {
sender: 6969,
max_message_size: 102_300,
max_capacity: 1000,
};
let channel_accepted_message = xcm::v3::Instruction::<PolimecCall>::HrmpChannelAccepted { recipient: 6969u32 };

let open_channel_message_real_weight = WeightInfo::do_handle_channel_open_request();
let open_channel_message_deducted_weight = XcmWeigher::instr_weight(&open_channel_message).unwrap();

let channel_accepted_message_real_weight = WeightInfo::do_handle_channel_accepted();
let channel_accepted_message_deducted_weight = XcmWeigher::instr_weight(&channel_accepted_message).unwrap();

assert!(open_channel_message_deducted_weight.all_gte(open_channel_message_real_weight));
assert!(channel_accepted_message_deducted_weight.all_gte(channel_accepted_message_real_weight));
}
2 changes: 1 addition & 1 deletion integration-tests/src/tests/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,4 @@ fn execution_fees_go_to_treasury() {
assert_reserve_asset_fee_goes_to_treasury(usdt_amount);
assert_reserve_asset_fee_goes_to_treasury(usdc_amount);
assert_plmc_fee_goes_to_treasury();
}
}
Loading