contracts: Emit event on contract termination (#8014)

* contracts: Remove redundant bool argument from the eviction event

* contracts: Improve event documentation

* contracts: Emit event on contract termination
This commit is contained in:
Alexander Theißen
2021-02-02 11:48:35 +01:00
committed by GitHub
parent de838f9464
commit 815409f31e
4 changed files with 74 additions and 27 deletions
+2 -1
View File
@@ -582,6 +582,7 @@ where
)?;
if let Some(ContractInfo::Alive(info)) = ContractInfoOf::<T>::take(&self_id) {
Storage::<T>::queue_trie_for_deletion(&info)?;
Contracts::<T>::deposit_event(RawEvent::Terminated(self_id, beneficiary.clone()));
Ok(())
} else {
panic!(
@@ -671,7 +672,7 @@ where
fn deposit_event(&mut self, topics: Vec<T::Hash>, data: Vec<u8>) {
deposit_event::<Self::T>(
topics,
RawEvent::ContractExecution(self.ctx.self_account.clone(), data)
RawEvent::ContractEmitted(self.ctx.self_account.clone(), data)
);
}