File tree Expand file tree Collapse file tree 4 files changed +6
-24
lines changed
Expand file tree Collapse file tree 4 files changed +6
-24
lines changed Original file line number Diff line number Diff line change @@ -587,13 +587,10 @@ impl MaxEncodedLen for MultiAssets {
587587
588588impl Decode for MultiAssets {
589589 fn decode < I : codec:: Input > ( input : & mut I ) -> Result < Self , codec:: Error > {
590- let mut bounded_instructions =
590+ let bounded_instructions =
591591 BoundedVec :: < MultiAsset , ConstU32 < { MAX_ITEMS_IN_MULTIASSETS as u32 } > > :: decode ( input) ?;
592-
593- bounded_instructions. sort ( ) ;
594-
595592 Self :: from_sorted_and_deduplicated ( bounded_instructions. into_inner ( ) )
596- . map_err ( |( ) | "Duplicate items " . into ( ) )
593+ . map_err ( |( ) | "Out of order " . into ( ) )
597594 }
598595}
599596
@@ -685,7 +682,6 @@ impl MultiAssets {
685682 pub fn from_sorted_and_deduplicated_skip_checks ( r : Vec < MultiAsset > ) -> Self {
686683 Self :: from_sorted_and_deduplicated ( r) . expect ( "Invalid input r is not sorted/deduped" )
687684 }
688-
689685 /// Create a new instance of `MultiAssets` from a `Vec<MultiAsset>` whose contents are sorted
690686 /// and which contain no duplicates.
691687 ///
Original file line number Diff line number Diff line change @@ -624,13 +624,10 @@ impl MaxEncodedLen for Assets {
624624
625625impl Decode for Assets {
626626 fn decode < I : codec:: Input > ( input : & mut I ) -> Result < Self , codec:: Error > {
627- let mut bounded_instructions =
627+ let bounded_instructions =
628628 BoundedVec :: < Asset , ConstU32 < { MAX_ITEMS_IN_ASSETS as u32 } > > :: decode ( input) ?;
629-
630- bounded_instructions. sort ( ) ;
631-
632629 Self :: from_sorted_and_deduplicated ( bounded_instructions. into_inner ( ) )
633- . map_err ( |( ) | "Duplicate items " . into ( ) )
630+ . map_err ( |( ) | "Out of order " . into ( ) )
634631 }
635632}
636633
Original file line number Diff line number Diff line change @@ -562,13 +562,10 @@ impl MaxEncodedLen for Assets {
562562
563563impl Decode for Assets {
564564 fn decode < I : codec:: Input > ( input : & mut I ) -> Result < Self , codec:: Error > {
565- let mut bounded_instructions =
565+ let bounded_instructions =
566566 BoundedVec :: < Asset , ConstU32 < { MAX_ITEMS_IN_ASSETS as u32 } > > :: decode ( input) ?;
567-
568- bounded_instructions. sort ( ) ;
569-
570567 Self :: from_sorted_and_deduplicated ( bounded_instructions. into_inner ( ) )
571- . map_err ( |( ) | "Duplicate items " . into ( ) )
568+ . map_err ( |( ) | "Out of order " . into ( ) )
572569 }
573570}
574571
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments