File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
substrate/frame/staking/src Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -758,10 +758,10 @@ impl<
758758 > PagedExposure < AccountId , Balance , MaxExposurePageSize >
759759{
760760 /// Create a new instance of `PagedExposure` from legacy clipped exposures (now removed).
761- pub fn from_clipped ( exposure : Exposure < AccountId , Balance > ) -> Result < Self , ( ) > {
762- let old_exposures = exposure. others . len ( ) ;
763- let others = WeakBoundedVec :: try_from ( exposure . others ) . unwrap_or_default ( ) ;
764- defensive_assert ! ( old_exposures == others . len ( ) , "Too many exposures for a page" ) ;
761+ pub fn from_clipped ( exposure : Exposure < AccountId , Balance > ) -> Result < Self , & ' static str > {
762+ let Ok ( others ) = WeakBoundedVec :: try_from ( exposure. others ) else {
763+ return Err ( "Too many exposures for a page" ) ;
764+ } ;
765765 Ok ( Self {
766766 exposure_metadata : PagedExposureMetadata {
767767 total : exposure. total ,
You can’t perform that action at this time.
0 commit comments