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

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

* New return value

* update kill outcome

* Update name

* "Update Substrate"

Co-authored-by: parity-processbot <>
parent ec73390f
Pipeline #125151 passed with stages
in 35 minutes and 32 seconds
This diff is collapsed.
......@@ -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")
}
......
......@@ -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()))
}
}
......
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