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
8 changes: 2 additions & 6 deletions polkadot/xcm/src/v3/multiasset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -587,13 +587,10 @@ impl MaxEncodedLen for MultiAssets {

impl Decode for MultiAssets {
fn decode<I: codec::Input>(input: &mut I) -> Result<Self, codec::Error> {
let mut bounded_instructions =
let bounded_instructions =
BoundedVec::<MultiAsset, ConstU32<{ MAX_ITEMS_IN_MULTIASSETS as u32 }>>::decode(input)?;

bounded_instructions.sort();

Self::from_sorted_and_deduplicated(bounded_instructions.into_inner())
.map_err(|()| "Duplicate items".into())
.map_err(|()| "Out of order".into())
}
}

Expand Down Expand Up @@ -685,7 +682,6 @@ impl MultiAssets {
pub fn from_sorted_and_deduplicated_skip_checks(r: Vec<MultiAsset>) -> Self {
Self::from_sorted_and_deduplicated(r).expect("Invalid input r is not sorted/deduped")
}

/// Create a new instance of `MultiAssets` from a `Vec<MultiAsset>` whose contents are sorted
/// and which contain no duplicates.
///
Expand Down
7 changes: 2 additions & 5 deletions polkadot/xcm/src/v4/asset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -624,13 +624,10 @@ impl MaxEncodedLen for Assets {

impl Decode for Assets {
fn decode<I: codec::Input>(input: &mut I) -> Result<Self, codec::Error> {
let mut bounded_instructions =
let bounded_instructions =
BoundedVec::<Asset, ConstU32<{ MAX_ITEMS_IN_ASSETS as u32 }>>::decode(input)?;

bounded_instructions.sort();

Self::from_sorted_and_deduplicated(bounded_instructions.into_inner())
.map_err(|()| "Duplicate items".into())
.map_err(|()| "Out of order".into())
}
}

Expand Down
7 changes: 2 additions & 5 deletions polkadot/xcm/src/v5/asset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -562,13 +562,10 @@ impl MaxEncodedLen for Assets {

impl Decode for Assets {
fn decode<I: codec::Input>(input: &mut I) -> Result<Self, codec::Error> {
let mut bounded_instructions =
let bounded_instructions =
BoundedVec::<Asset, ConstU32<{ MAX_ITEMS_IN_ASSETS as u32 }>>::decode(input)?;

bounded_instructions.sort();

Self::from_sorted_and_deduplicated(bounded_instructions.into_inner())
.map_err(|()| "Duplicate items".into())
.map_err(|()| "Out of order".into())
}
}

Expand Down
8 changes: 0 additions & 8 deletions prdoc/stable2512/pr_9842.prdoc

This file was deleted.

Loading