Skip to content

Commit

Permalink
feat(220): do_evaluation_end uses the config type as threshold. Confi…
Browse files Browse the repository at this point in the history
…g type renamed
  • Loading branch information
JuaniRios committed Jul 21, 2023
1 parent dc304a4 commit 66ecfd0
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions polimec-skeleton/pallets/funding/src/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ impl<T: Config> Pallet<T> {
total.saturating_add(user_total_plmc_bond)
});

let evaluation_target_usd = Perquintill::from_percent(10) * fundraising_target_usd;
let evaluation_target_usd = <T as Config>::EvaluationSuccessThreshold::get() * fundraising_target_usd;
let evaluation_target_plmc = current_plmc_price
.reciprocal()
.ok_or(Error::<T>::BadMath)?
Expand Down Expand Up @@ -790,7 +790,7 @@ impl<T: Config> Pallet<T> {
let mut caller_existing_evaluations = Evaluations::<T>::get(project_id, evaluator.clone());
let plmc_usd_price = T::PriceProvider::get_price(PLMC_STATEMINT_ID).ok_or(Error::<T>::PLMCPriceNotAvailable)?;
let early_evaluation_reward_threshold_usd =
T::EarlyEvaluationThreshold::get() * project_details.fundraising_target;
T::EvaluationSuccessThreshold::get() * project_details.fundraising_target;
let evaluation_round_info = &mut project_details.evaluation_round_info;

// * Validity Checks *
Expand Down
2 changes: 1 addition & 1 deletion polimec-skeleton/pallets/funding/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ pub mod pallet {

type FeeBrackets: Get<Vec<(Percent, Self::Balance)>>;

type EarlyEvaluationThreshold: Get<Percent>;
type EvaluationSuccessThreshold: Get<Percent>;
}

#[pallet::storage]
Expand Down
2 changes: 1 addition & 1 deletion polimec-skeleton/pallets/funding/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ impl pallet_funding::Config for TestRuntime {
type BenchmarkHelper = ();
type WeightInfo = ();
type FeeBrackets = FeeBrackets;
type EarlyEvaluationThreshold = EarlyEvaluationThreshold;
type EvaluationSuccessThreshold = EarlyEvaluationThreshold;
}

// Build genesis storage according to the mock runtime.
Expand Down
2 changes: 1 addition & 1 deletion polimec-skeleton/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ impl pallet_funding::Config for Runtime {
type BenchmarkHelper = ();
type WeightInfo = ();
type FeeBrackets = FeeBrackets;
type EarlyEvaluationThreshold = EarlyEvaluationThreshold;
type EvaluationSuccessThreshold = EarlyEvaluationThreshold;
}

impl pallet_credentials::Config for Runtime {
Expand Down

0 comments on commit 66ecfd0

Please sign in to comment.