-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/plmc 266 add verification code on extrinsic benchmarks #89
Feature/plmc 266 add verification code on extrinsic benchmarks #89
Conversation
Evaluations::<T>::get((project_id, evaluator.clone(), evaluation_to_unbond.id)).unwrap(); | ||
assert!(stored_evaluation.rewarded_or_slashed); | ||
let slashed_amount = T::EvaluatorSlash::get() * evaluation_to_unbond.original_plmc_bond; | ||
let current_plmc_bond = evaluation_to_unbond.current_plmc_bond.saturating_sub(slashed_amount); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case the evaluator is not participating in any other round so its fine.
But keep in mind that evaluators can use their plmc bonded in the evaluation phase to participate in bid/contribution rounds.
If this happens then the current_bond is reduced, even though no slash occured.
|
||
// validity checks | ||
assert_eq!(project_status, UpdateType::ProjectDecision(FundingOutcomeDecision::AcceptFunding)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add an event to this
|
||
// * validity checks * | ||
// Storage | ||
assert!(!Bids::<T>::contains_key((project_id, bidder.clone(), stored_bid.id))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice check, will def steal it :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Solid update on the benchmarks! I've added a few minor comments in addition to Juan's. Please note there are some unnecessary .clone()
instances scattered throughout, but they can be addressed in a subsequent PR.
current_plmc_bond, | ||
rewarded_or_slashed, | ||
.. | ||
} if project_id == project_id && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
project_id
is always equal to itself, or am I missing something?
pallets/funding/src/benchmarking.rs
Outdated
evaluator == evaluator.clone() && | ||
original_plmc_bond == plmc_for_evaluating[0].plmc_amount && | ||
current_plmc_bond == plmc_for_evaluating[0].plmc_amount && | ||
rewarded_or_slashed == false => {}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick:
rewarded_or_slashed == false => {}, | |
!rewarded_or_slashed => {}, |
No description provided.