Unverified Commit 9dd75c5c authored by Shawn Tabrizi's avatar Shawn Tabrizi Committed by GitHub
Browse files

Crowdloan Updates (#2166)

* Rename crowdfund -> crowdloan

* allow contribution on behalf of another user

* starting some benchmarks

* optimization: use append api

* Use on_initialize instead of on_finalize

* More benchmarks

* try to implement partial child storage removal

* partial dissolve test

* onboard benchmark

* begin retirement

* on_initialize

* remove _ { }

* Revert "allow contribution on behalf of another user"

This reverts commit b7dd7d1e

.

* finish undo of "allow contribution on behalf of another user"

* Allow any user to trigger withdraw on closed crowdloan

* use transfer instead of withdraw/create pattern

* unused warning

* Update runtime/common/src/crowdloan.rs

Co-authored-by: default avatarKian Paimani <5588131+kianenigma@users.noreply.github.com>

* dont need to assign to empty variable

Co-authored-by: default avatarKian Paimani <5588131+kianenigma@users.noreply.github.com>
parent b2fea426
Pipeline #119736 passed with stages
in 30 minutes and 6 seconds
......@@ -21,7 +21,7 @@
pub mod claims;
pub mod slot_range;
pub mod slots;
pub mod crowdfund;
pub mod crowdloan;
pub mod purchase;
pub mod impls;
pub mod paras_sudo_wrapper;
......
......@@ -579,9 +579,9 @@ impl<T: Config> Module<T> {
/// ending. An immediately subsequent call with the same argument will always return `None`.
fn check_auction_end(now: T::BlockNumber) -> Option<(WinningData<T>, LeasePeriodOf<T>)> {
if let Some((lease_period_index, early_end)) = <AuctionInfo<T>>::get() {
if early_end + T::EndingPeriod::get() == now {
let ending_period = T::EndingPeriod::get();
if early_end + ending_period == now {
// Just ended!
let ending_period = T::EndingPeriod::get();
let offset = T::BlockNumber::decode(&mut T::Randomness::random_seed().as_ref())
.expect("secure hashes always bigger than block numbers; qed") % ending_period;
let res = <Winning<T>>::get(offset).unwrap_or_default();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment