mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-06 23:08:03 +00:00
[Fix] Weight calculations for Wild -> affects teleports (#1639)
* [Fix] Weight calculations for Wild -> affects teleports * introduce a separate asset limit for teleports * fix deposit * reshuffle abstractions * fix imports * little refactoring * Update parachains/common/src/xcm_config.rs Co-authored-by: Squirrel <gilescope@gmail.com> * add comments Co-authored-by: Squirrel <gilescope@gmail.com>
This commit is contained in:
@@ -119,3 +119,17 @@ impl<Location: Get<MultiLocation>> FilterAssetLocation for ConcreteNativeAssetFr
|
||||
matches!(asset.id, Concrete(ref id) if id == origin && origin == &Location::get())
|
||||
}
|
||||
}
|
||||
|
||||
/// A generic function to use for MultiAssetFilter implementations, currently used to differentiate
|
||||
/// between reserve operations and the rest of them.
|
||||
pub fn weigh_multi_assets_generic(
|
||||
filter: &MultiAssetFilter,
|
||||
weight: Weight,
|
||||
max_assets: u32,
|
||||
) -> XCMWeight {
|
||||
let multiplier = match filter {
|
||||
MultiAssetFilter::Definite(assets) => assets.len() as u64,
|
||||
MultiAssetFilter::Wild(_) => max_assets as u64,
|
||||
};
|
||||
weight.saturating_mul(multiplier).ref_time()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user