Companion to Substrate #11490 (#5603)

* Fix warnings

* Bump
This commit is contained in:
Gavin Wood
2022-05-30 11:21:03 +01:00
committed by GitHub
parent f814695d5d
commit 026848c932
8 changed files with 205 additions and 174 deletions
+171 -171
View File
File diff suppressed because it is too large Load Diff
+20 -3
View File
@@ -22,6 +22,7 @@ use sc_executor_common::{
};
use sc_executor_wasmtime::{Config, DeterministicStackLimit, Semantics};
use sp_core::storage::{ChildInfo, TrackedStorageKey};
use sp_externalities::MultiRemovalResults;
use std::{
any::{Any, TypeId},
path::Path,
@@ -160,15 +161,31 @@ impl sp_externalities::Externalities for ValidationExternalities {
panic!("child_storage: unsupported feature for parachain validation")
}
fn kill_child_storage(&mut self, _: &ChildInfo, _: Option<u32>) -> (bool, u32) {
fn kill_child_storage(
&mut self,
_child_info: &ChildInfo,
_maybe_limit: Option<u32>,
_maybe_cursor: Option<&[u8]>,
) -> MultiRemovalResults {
panic!("kill_child_storage: unsupported feature for parachain validation")
}
fn clear_prefix(&mut self, _: &[u8], _: Option<u32>) -> (bool, u32) {
fn clear_prefix(
&mut self,
_prefix: &[u8],
_maybe_limit: Option<u32>,
_maybe_cursor: Option<&[u8]>,
) -> MultiRemovalResults {
panic!("clear_prefix: unsupported feature for parachain validation")
}
fn clear_child_prefix(&mut self, _: &ChildInfo, _: &[u8], _: Option<u32>) -> (bool, u32) {
fn clear_child_prefix(
&mut self,
_child_info: &ChildInfo,
_prefix: &[u8],
_maybe_limit: Option<u32>,
_maybe_cursor: Option<&[u8]>,
) -> MultiRemovalResults {
panic!("clear_child_prefix: unsupported feature for parachain validation")
}
+2
View File
@@ -305,6 +305,7 @@ pub mod pallet {
for ((bidder, _), amount) in ReservedAmounts::<T>::drain() {
CurrencyOf::<T>::unreserve(&bidder, amount);
}
#[allow(deprecated)]
Winning::<T>::remove_all(None);
AuctionInfo::<T>::kill();
Ok(())
@@ -557,6 +558,7 @@ impl<T: Config> Pallet<T> {
.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.
#[allow(deprecated)]
Winning::<T>::remove_all(None);
AuctionInfo::<T>::kill();
return Some((res, lease_period_index))
@@ -691,6 +691,7 @@ impl<T: Config> Pallet<T> {
}
pub fn crowdloan_kill(index: FundIndex) -> child::KillStorageResult {
#[allow(deprecated)]
child::kill_storage(&Self::id_from_index(index), Some(T::RemoveKeysLimit::get()))
}
+5
View File
@@ -451,10 +451,15 @@ pub fn remove_pallet<T>() -> frame_support::weights::Weight
where
T: frame_system::Config,
{
#[allow(deprecated)]
use frame_support::migration::remove_storage_prefix;
#[allow(deprecated)]
remove_storage_prefix(b"Purchase", b"Accounts", b"");
#[allow(deprecated)]
remove_storage_prefix(b"Purchase", b"PaymentAccount", b"");
#[allow(deprecated)]
remove_storage_prefix(b"Purchase", b"Statement", b"");
#[allow(deprecated)]
remove_storage_prefix(b"Purchase", b"UnlockBlock", b"");
<T as frame_system::Config>::BlockWeights::get().max_block
@@ -638,7 +638,9 @@ impl<T: paras_inherent::Config> BenchBuilder<T> {
pub(crate) fn build(self) -> Bench<T> {
// Make sure relevant storage is cleared. This is just to get the asserts to work when
// running tests because it seems the storage is not cleared in between.
#[allow(deprecated)]
inclusion::PendingAvailabilityCommitments::<T>::remove_all(None);
#[allow(deprecated)]
inclusion::PendingAvailability::<T>::remove_all(None);
// We don't allow a core to have both disputes and be marked fully available at this block.
@@ -852,10 +852,12 @@ impl<T: Config> Pallet<T> {
for to_prune in to_prune {
// This should be small, as disputes are rare, so `None` is fine.
#[allow(deprecated)]
<Disputes<T>>::remove_prefix(to_prune, None);
// This is larger, and will be extracted to the `shared` pallet for more proper pruning.
// TODO: https://github.com/paritytech/polkadot/issues/3469
#[allow(deprecated)]
<Included<T>>::remove_prefix(to_prune, None);
SpamSlots::<T>::remove(to_prune);
}
@@ -516,6 +516,7 @@ fn bitfield_checks() {
);
// clean up
#[allow(deprecated)]
PendingAvailability::<Test>::remove_all(None);
}
@@ -574,6 +575,7 @@ fn bitfield_checks() {
0
);
#[allow(deprecated)]
PendingAvailability::<Test>::remove_all(None);
}