contracts: Add event field names (#9896)

* Add struct variant fields to contract Event

* Update comments and usages

* Fmt
This commit is contained in:
Andrew Jones
2021-09-30 09:12:25 +01:00
committed by GitHub
parent 817d0d26d5
commit e0742bcd6d
4 changed files with 57 additions and 45 deletions
+22 -27
View File
@@ -369,49 +369,44 @@ pub mod pallet {
#[pallet::event]
#[pallet::generate_deposit(pub(super) fn deposit_event)]
pub enum Event<T: Config> {
/// Contract deployed by address at the specified address. \[deployer, contract\]
Instantiated(T::AccountId, T::AccountId),
/// Contract deployed by address at the specified address.
Instantiated { deployer: T::AccountId, contract: T::AccountId },
/// Contract has been removed.
/// \[contract, beneficiary\]
///
/// # Params
///
/// - `contract`: The contract that was terminated.
/// - `beneficiary`: The account that received the contracts remaining balance.
///
/// # Note
///
/// The only way for a contract to be removed and emitting this event is by calling
/// `seal_terminate`.
Terminated(T::AccountId, T::AccountId),
Terminated {
/// The contract that was terminated.
contract: T::AccountId,
/// The account that received the contracts remaining balance
beneficiary: T::AccountId,
},
/// Code with the specified hash has been stored. \[code_hash\]
CodeStored(T::Hash),
/// Code with the specified hash has been stored.
CodeStored { code_hash: T::Hash },
/// Triggered when the current schedule is updated.
/// \[version\]
///
/// # Params
///
/// - `version`: The version of the newly set schedule.
ScheduleUpdated(u32),
ScheduleUpdated {
/// The version of the newly set schedule.
version: u32,
},
/// A custom event emitted by the contract.
/// \[contract, data\]
///
/// # Params
///
/// - `contract`: The contract that emitted the event.
/// - `data`: Data supplied by the contract. Metadata generated during contract compilation
/// is needed to decode it.
ContractEmitted(T::AccountId, Vec<u8>),
ContractEmitted {
/// The contract that emitted the event.
contract: T::AccountId,
/// Data supplied by the contract. Metadata generated during contract compilation
/// is needed to decode it.
data: Vec<u8>,
},
/// A code with the specified hash was removed.
/// \[code_hash\]
///
/// This happens when the last contract that uses this code hash was removed.
CodeRemoved(T::Hash),
CodeRemoved { code_hash: T::Hash },
}
#[pallet::error]