-
Notifications
You must be signed in to change notification settings - Fork 69
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
feat: staking #639
feat: staking #639
Conversation
…e into feat/staking
//0.1 | ||
Conviction::None => FixedU128::from_inner(100_000_000_000_000_000_u128), |
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.
from_rational(1, 10)
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.
Why? from_rational()
is doing wasteful computations in this case and in my opinion readability improvement won't be that high.
This is basically set and forget, this value may won't be changed ever
fn is_referendum_finished(index: ReferendumIndex) -> bool; | ||
} | ||
|
||
pub(crate) trait ActionData { |
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.
What's the purpose of this trait? I believe we can live happily without it and implement the methods directly for Vote
struct.
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.
/// Unit we are distributing action points for. | ||
/// e.g if RewardedVoteUnit is 1HDX user will receive `x` action points per each voted 1 HDX. | ||
#[pallet::constant] | ||
type RewardedVoteUnit: Get<Balance>; |
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.
I have a hard time to understand what the param does from the comment. Is it the amount corresponding to 1 action point?
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.
Not necessarily, amount of action points distributed per "unit" is also configurable.
e.g it can be cofigrted to distribute 4 action points per each voted 25HDX
AlreadyInitialized, | ||
|
||
/// Arithmetic error. | ||
Arithmetic, |
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.
can be replaced by ArithmeticError::Overflow
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.
This was refactored by @enthusiastmartin so he can reason why
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.
Dunno why I think I saw vote storages not cleaned up b4 but it's not the case anymore after re-testing. Did some nitpick / docs fixes. so LGTM.
Description
Staking pallet allows users to stake HDX tokens with loyalty(time) and governance actions incentivization.