File tree Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Original file line number Diff line number Diff line change 11use super :: * ;
2- use crate :: alloc:: borrow:: ToOwned ;
32use alloc:: collections:: BTreeMap ;
43use safe_math:: FixedExt ;
54use substrate_fixed:: transcendental:: { exp, ln} ;
@@ -11,10 +10,10 @@ impl<T: Config> Pallet<T> {
1110 // Filter out root subnet.
1211 // Filter out subnets with no first emission block number.
1312 subnets
14- . to_owned ( )
15- . into_iter ( )
16- . filter ( |netuid| * netuid != NetUid :: ROOT )
17- . filter ( |netuid| FirstEmissionBlockNumber :: < T > :: get ( * netuid ) . is_some ( ) )
13+ . iter ( )
14+ . filter ( | & netuid| * netuid != NetUid :: ROOT )
15+ . filter ( |& netuid| FirstEmissionBlockNumber :: < T > :: get ( * netuid ) . is_some ( ) )
16+ . copied ( )
1817 . collect ( )
1918 }
2019
Original file line number Diff line number Diff line change @@ -3056,7 +3056,7 @@ fn test_mining_emission_distribution_with_subsidy() {
30563056 let miner_incentive: AlphaCurrency =
30573057 ( * Incentive :: < Test > :: get ( NetUidStorageIndex :: from ( netuid) )
30583058 . get ( miner_uid as usize )
3059- . expect ( "Miner uid should be present" ) as u64 )
3059+ . unwrap_or ( & 0 ) as u64 )
30603060 . into ( ) ;
30613061 log:: info!( "Miner incentive: {miner_incentive:?}" ) ;
30623062
@@ -3224,7 +3224,7 @@ fn test_mining_emission_distribution_with_no_subsidy() {
32243224 let miner_incentive: AlphaCurrency =
32253225 ( * Incentive :: < Test > :: get ( NetUidStorageIndex :: from ( netuid) )
32263226 . get ( miner_uid as usize )
3227- . expect ( "Miner uid should be present" ) as u64 )
3227+ . unwrap_or ( & 0 ) as u64 )
32283228 . into ( ) ;
32293229 log:: info!( "Miner incentive: {miner_incentive:?}" ) ;
32303230
You can’t perform that action at this time.
0 commit comments