Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Companion for #9106 (remove_all with size limit) #3257

Merged
4 commits merged into from
Jun 15, 2021
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions node/core/pvf/src/executor_intf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,11 @@ impl sp_externalities::Externalities for ValidationExternalities {
panic!("kill_child_storage: unsupported feature for parachain validation")
}

fn clear_prefix(&mut self, _: &[u8]) {
fn clear_prefix(&mut self, _: &[u8], _: Option<u32>) -> (bool, u32) {
panic!("clear_prefix: unsupported feature for parachain validation")
}

fn clear_child_prefix(&mut self, _: &ChildInfo, _: &[u8]) {
fn clear_child_prefix(&mut self, _: &ChildInfo, _: &[u8], _: Option<u32>) -> (bool, u32) {
panic!("clear_child_prefix: unsupported feature for parachain validation")
}

Expand Down
4 changes: 2 additions & 2 deletions runtime/common/src/auctions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ pub mod pallet {
for ((bidder, _), amount) in ReservedAmounts::<T>::drain() {
CurrencyOf::<T>::unreserve(&bidder, amount);
}
Winning::<T>::remove_all();
Winning::<T>::remove_all(None);
AuctionInfo::<T>::kill();
Ok(())
}
Expand Down Expand Up @@ -511,7 +511,7 @@ impl<T: Config> Pallet<T> {
let res = Winning::<T>::get(offset).unwrap_or([Self::EMPTY; SlotRange::SLOT_RANGE_COUNT]);
// This `remove_all` statement should remove at most `EndingPeriod` / `SampleLength` items,
// which should be bounded and sensibly configured in the runtime.
Winning::<T>::remove_all();
Winning::<T>::remove_all(None);
AuctionInfo::<T>::kill();
return Some((res, lease_period_index))
}
Expand Down
2 changes: 1 addition & 1 deletion runtime/common/src/crowdloan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@ impl<T: Config> Pallet<T> {
who.using_encoded(|b| child::kill(&Self::id_from_index(index), b));
}

pub fn crowdloan_kill(index: TrieIndex) -> child::KillChildStorageResult {
pub fn crowdloan_kill(index: TrieIndex) -> child::KillStorageResult {
child::kill_storage(&Self::id_from_index(index), Some(T::RemoveKeysLimit::get()))
}

Expand Down