From 50d75187cfb0b943e377a15e5615ec8d2ff3ebdb Mon Sep 17 00:00:00 2001 From: Juan Ignacio Rios Date: Thu, 10 Aug 2023 16:02:31 +0200 Subject: [PATCH] chore(240): fmt --- pallets/funding/src/functions.rs | 1 - pallets/funding/src/impls.rs | 1 - pallets/funding/src/tests.rs | 47 ++++++++++++++------------------ 3 files changed, 21 insertions(+), 28 deletions(-) diff --git a/pallets/funding/src/functions.rs b/pallets/funding/src/functions.rs index 2891fe277..2cb1b2b15 100644 --- a/pallets/funding/src/functions.rs +++ b/pallets/funding/src/functions.rs @@ -1527,7 +1527,6 @@ impl Pallet { let project_details = ProjectsDetails::::get(project_id).ok_or(Error::::ProjectInfoNotFound)?; let mut bid = Bids::::get((project_id, bidder.clone(), bid_id)).ok_or(Error::::BidNotFound)?; - // * Validity checks * ensure!( project_details.status == ProjectStatus::FundingSuccessful && diff --git a/pallets/funding/src/impls.rs b/pallets/funding/src/impls.rs index 6308ab931..d69c47753 100644 --- a/pallets/funding/src/impls.rs +++ b/pallets/funding/src/impls.rs @@ -616,7 +616,6 @@ fn issuer_funding_payout_one_bid(project_id: T::ProjectIdentifier) -> }), }; (Weight::zero(), remaining_bids.count() as u64) - } else { (Weight::zero(), 0u64) } diff --git a/pallets/funding/src/tests.rs b/pallets/funding/src/tests.rs index e01d9a3d8..e9d95ac82 100644 --- a/pallets/funding/src/tests.rs +++ b/pallets/funding/src/tests.rs @@ -2965,13 +2965,13 @@ mod auction_round_success { let remainder_contributions = vec![]; let finished_project = FinishedProject::new_with( - &test_env, - project, - issuer, - evaluations, - bids, - community_contributions, - remainder_contributions, + &test_env, + project, + issuer, + evaluations, + bids, + community_contributions, + remainder_contributions, ); let project_id = finished_project.get_project_id(); let final_bid_payouts = test_env.in_ext(|| { @@ -2979,24 +2979,22 @@ mod auction_round_success { .map(|bid| (bid.bidder, bid.funding_asset_amount_locked, bid.funding_asset.to_statemint_id())) .collect::() }); - let total_expected_bid_payout = final_bid_payouts.iter().map(|bid| bid.1.clone()).sum::>(); + let total_expected_bid_payout = + final_bid_payouts.iter().map(|bid| bid.1.clone()).sum::>(); - let prev_issuer_funding_balance = test_env.get_free_statemint_asset_balances_for( - final_bid_payouts[0].2, - vec![issuer.clone()], - )[0].1; + let prev_issuer_funding_balance = + test_env.get_free_statemint_asset_balances_for(final_bid_payouts[0].2, vec![issuer.clone()])[0].1; let prev_bidders_funding_balances = test_env.get_free_statemint_asset_balances_for( final_bid_payouts[0].2, final_bid_payouts.iter().map(|(acc, _, _)| acc.clone()).collect::>(), ); - let prev_total_bidder_balance = prev_bidders_funding_balances - .iter() - .map(|(_, balance, _)| balance) - .sum::>(); + let prev_total_bidder_balance = + prev_bidders_funding_balances.iter().map(|(_, balance, _)| balance).sum::>(); let prev_project_pot_funding_balance = test_env.get_free_statemint_asset_balances_for( final_bid_payouts[0].2, vec![Pallet::::fund_account_id(project_id)], - )[0].1; + )[0] + .1; test_env.advance_time(::SuccessToSettlementTime::get() + 1).unwrap(); assert_eq!( @@ -3004,22 +3002,19 @@ mod auction_round_success { Cleaner::Success(CleanerState::Finished(PhantomData)) ); - let post_issuer_funding_balance = test_env.get_free_statemint_asset_balances_for( - final_bid_payouts[0].2, - vec![issuer.clone()], - )[0].1; + let post_issuer_funding_balance = + test_env.get_free_statemint_asset_balances_for(final_bid_payouts[0].2, vec![issuer.clone()])[0].1; let post_bidders_funding_balances = test_env.get_free_statemint_asset_balances_for( final_bid_payouts[0].2, final_bid_payouts.iter().map(|(acc, _, _)| acc.clone()).collect::>(), ); - let post_total_bidder_balance = post_bidders_funding_balances - .iter() - .map(|(_, balance, _)| balance) - .sum::>(); + let post_total_bidder_balance = + post_bidders_funding_balances.iter().map(|(_, balance, _)| balance).sum::>(); let post_project_pot_funding_balance = test_env.get_free_statemint_asset_balances_for( final_bid_payouts[0].2, vec![Pallet::::fund_account_id(project_id)], - )[0].1; + )[0] + .1; let issuer_funding_delta = post_issuer_funding_balance - prev_issuer_funding_balance; let bidders_funding_delta = prev_total_bidder_balance - post_total_bidder_balance;