-
Notifications
You must be signed in to change notification settings - Fork 112
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
[AHM] Crowdloans #592
[AHM] Crowdloans #592
Conversation
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
pallets/rc-migrator/src/crowdloan.rs
Outdated
let period = <T as pallet_slots::Config>::LeasePeriod::get(); | ||
|
||
let current_period = (now - offset) / period; | ||
(current_period + num_leases) * period + offset |
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.
may be (current_period + (num_leases - 1)) * period + offset
, since num_leases
also includes the current lease
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 think not, since we need to calculate the ending block and the integer division always returns the beginning period.
The current_period * period
is the beginning of the current period. So if we have current_period=0, num_leases=0
then we can return that. But if we have current_period=0, num_leases=1
then we need to return period * 1
to get the end of the current one.
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
pallets/ah-ops/src/lib.rs
Outdated
|
||
pub type BalanceOf<T> = <T as pallet_balances::Config>::Balance; | ||
|
||
#[frame_support::pallet(dev_mode)] |
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.
TODO benchmarks?
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.
Yes, i removed the dev_mode now so that we get a compiler warning for missing benchmarks.
Co-authored-by: muharem <[email protected]>
Co-authored-by: muharem <[email protected]>
Co-authored-by: muharem <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
To be merged into the AHM branch
TODO: write user impact and add tests