File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed
Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -586,7 +586,7 @@ impl<T: Config> Pallet<T> {
586586
587587 const MAX_REVEALS : usize = 10 ;
588588 if existing_reveals. len ( ) > MAX_REVEALS {
589- let remove_count = existing_reveals. len ( ) - MAX_REVEALS ;
589+ let remove_count = existing_reveals. len ( ) . saturating_sub ( MAX_REVEALS ) ;
590590 existing_reveals. drain ( 0 ..remove_count) ;
591591 }
592592
Original file line number Diff line number Diff line change @@ -1686,7 +1686,8 @@ fn revealed_commitments_keeps_only_10_newest_with_individual_single_field_commit
16861686 ) ;
16871687 }
16881688
1689- let revealed = RevealedCommitments :: < Test > :: get ( netuid, who) . unwrap ( ) ;
1689+ let revealed =
1690+ RevealedCommitments :: < Test > :: get ( netuid, who) . expect ( "expected to not panic" ) ;
16901691 assert_eq ! (
16911692 revealed. len( ) ,
16921693 10 ,
You can’t perform that action at this time.
0 commit comments