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 b7dd7d1ec751495cee3ddb57133a13c390b020e5.

* 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: Kian Paimani <5588131+kianenigma@users.noreply.github.com>

* dont need to assign to empty variable

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
This commit is contained in:
Shawn Tabrizi
2021-01-11 16:19:45 -04:00
committed by GitHub
parent 6c3c7d54b0
commit 9aebac3c69
3 changed files with 576 additions and 229 deletions
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -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;
+2 -2
View File
@@ -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();