Companion for 8166 (Update storage_kill return value) (#2488)

* New return value

* update kill outcome

* Update name

* "Update Substrate"

Co-authored-by: parity-processbot <>
This commit is contained in:
Shawn Tabrizi
2021-02-22 11:53:20 -08:00
committed by GitHub
parent c120e7d83a
commit 5b57f02e80
3 changed files with 145 additions and 143 deletions
+139 -139
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -286,7 +286,7 @@ impl sp_externalities::Externalities for ValidationExternalities {
panic!("child_storage: unsupported feature for parachain validation")
}
fn kill_child_storage(&mut self, _: &ChildInfo, _: Option<u32>) -> bool {
fn kill_child_storage(&mut self, _: &ChildInfo, _: Option<u32>) -> (bool, u32) {
panic!("kill_child_storage: unsupported feature for parachain validation")
}
+5 -3
View File
@@ -486,7 +486,8 @@ decl_module! {
// Try killing the crowdloan child trie
match Self::crowdloan_kill(index) {
child::KillOutcome::AllRemoved => {
// TODO use this value for refund
child::KillChildStorageResult::AllRemoved(_) => {
let account = Self::fund_account_id(index);
T::Currency::transfer(&account, &fund.owner, fund.deposit, AllowDeath)?;
@@ -498,7 +499,8 @@ decl_module! {
Self::deposit_event(RawEvent::Dissolved(index));
},
child::KillOutcome::SomeRemaining => {
// TODO use this value for refund
child::KillChildStorageResult::SomeRemaining(_) => {
Self::deposit_event(RawEvent::PartiallyDissolved(index));
}
}
@@ -569,7 +571,7 @@ impl<T: Config> Module<T> {
who.using_encoded(|b| child::kill(&Self::id_from_index(index), b));
}
pub fn crowdloan_kill(index: FundIndex) -> child::KillOutcome {
pub fn crowdloan_kill(index: FundIndex) -> child::KillChildStorageResult {
child::kill_storage(&Self::id_from_index(index), Some(T::RemoveKeysLimit::get()))
}
}