Skip to content

Commit

Permalink
experiment hrmp weighing
Browse files Browse the repository at this point in the history
  • Loading branch information
JuaniRios committed Jul 5, 2024
1 parent b0dc943 commit e97585b
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 1 deletion.
1 change: 1 addition & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions integration-tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ scale-info = { workspace = true, features = ["derive"] }

# Local
polimec-receiver.workspace = true
polimec-xcm-executor.workspace = true
macros.workspace = true
polimec-common.workspace = true
polimec-common-test-utils.workspace = true
Expand Down
12 changes: 12 additions & 0 deletions integration-tests/src/tests/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,15 @@ fn execution_fees_go_to_treasury() {
assert_reserve_asset_fee_goes_to_treasury(usdc_amount);
assert_plmc_fee_goes_to_treasury();
}

#[test]
fn xcm_weight() {
use polimec_xcm_executor::polimec_traits::WeightBounds;
type Weigher = <polimec_runtime::xcm_config::XcmConfig as polimec_xcm_executor::Config>::Weigher;
let mut simple_xcm = Xcm::<PolimecCall>(vec![
WithdrawAsset(vec![MultiAsset{ id: Concrete(Here.into()), fun: Fungibility::Fungible(10_000_000_000_0) }].into()),
DepositAsset { assets: MultiAssetFilter::Wild(WildMultiAsset::All), beneficiary: MultiLocation::new(0, X1(AccountId32 { network: None, id: [0u8; 32] })) }
]);
dbg!(Weigher::weight(&mut simple_xcm).unwrap());

}
2 changes: 1 addition & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ benchmark-runtime chain="polimec-paseo-local" pallet="pallet-elections-phragmen"
# src: https://github.com/paritytech/polkadot-sdk/blob/bc2e5e1fe26e2c2c8ee766ff9fe7be7e212a0c62/substrate/frame/nfts/src/weights.rs
# Run the Runtime benchmarks for a specific pallet
benchmark-pallet chain="polimec-paseo-local" pallet="pallet-dispenser":
cargo run --features runtime-benchmarks --release -p polimec-node benchmark pallet \
cargo run --features runtime-benchmarks --profile=production -p polimec-node benchmark pallet \
--chain={{ chain }} \
--steps=50 \
--repeat=20 \
Expand Down

0 comments on commit e97585b

Please sign in to comment.