Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

More app-friendly event description #6684

Merged
merged 4 commits into from
Jul 20, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions frame/assets/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,11 +230,11 @@ decl_event! {
<T as Trait>::Balance,
<T as Trait>::AssetId,
{
/// Some assets were issued.
/// Some assets were issued. [asset_id, origin, total_supply]
warfollowsme marked this conversation as resolved.
Show resolved Hide resolved
Issued(AssetId, AccountId, Balance),
/// Some assets were transferred.
/// Some assets were transferred. [asset_id, from, to, amount]
Transferred(AssetId, AccountId, AccountId, Balance),
/// Some assets were destroyed.
/// Some assets were destroyed. [asset_id, origin, balance]
warfollowsme marked this conversation as resolved.
Show resolved Hide resolved
Destroyed(AssetId, AccountId, Balance),
}
}
Expand Down
3 changes: 2 additions & 1 deletion frame/atomic-swap/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,8 @@ decl_event!(
{
/// Swap created.
NewSwap(AccountId, HashedProof, PendingSwap),
/// Swap claimed. The last parameter indicates whether the execution succeeds.
/// Swap claimed. The last parameter indicates whether the execution succeeds.
/// [account, proof, success]
SwapClaimed(AccountId, HashedProof, bool),
/// Swap cancelled.
SwapCancelled(AccountId, HashedProof),
Expand Down
7 changes: 4 additions & 3 deletions frame/balances/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,18 +248,19 @@ decl_event!(
/// An account was removed whose balance was non-zero but below ExistentialDeposit,
/// resulting in an outright loss.
DustLost(AccountId, Balance),
/// Transfer succeeded (from, to, value).
/// Transfer succeeded. [from, to, value]
Transfer(AccountId, AccountId, Balance),
/// A balance was set by root (who, free, reserved).
/// A balance was set by root. [who, free, reserved]
BalanceSet(AccountId, Balance, Balance),
/// Some amount was deposited (e.g. for transaction fees).
/// Some amount was deposited (e.g. for transaction fees). [who, deposit]
Deposit(AccountId, Balance),
/// Some balance was reserved (moved from free to reserved).
Reserved(AccountId, Balance),
/// Some balance was unreserved (moved from reserved to free).
Unreserved(AccountId, Balance),
/// Some balance was moved from the reserve of the first account to the second account.
/// Final argument indicates the destination balance type.
/// [from, to, balance, destination_status]
ReserveRepatriated(AccountId, AccountId, Balance, Status),
}
);
Expand Down
18 changes: 10 additions & 8 deletions frame/democracy/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -469,35 +469,37 @@ decl_event! {
{
/// A motion has been proposed by a public account.
Proposed(PropIndex, Balance),
/// A public proposal has been tabled for referendum vote.
/// A public proposal has been tabled for referendum vote. [proposal, deposit, depositors]
Tabled(PropIndex, Balance, Vec<AccountId>),
/// An external proposal has been tabled.
ExternalTabled,
/// A referendum has begun.
/// A referendum has begun. [ref_index, threshold]
Started(ReferendumIndex, VoteThreshold),
/// A proposal has been approved by referendum.
Passed(ReferendumIndex),
/// A proposal has been rejected by referendum.
NotPassed(ReferendumIndex),
/// A referendum has been cancelled.
Cancelled(ReferendumIndex),
/// A proposal has been enacted.
/// A proposal has been enacted. [ref_index, is_ok]
Executed(ReferendumIndex, bool),
/// An account has delegated their vote to another account.
/// An account has delegated their vote to another account. [who, target]
Delegated(AccountId, AccountId),
/// An account has cancelled a previous delegation operation.
Undelegated(AccountId),
/// An external proposal has been vetoed.
/// An external proposal has been vetoed. [who, proposal_hash, until]
Vetoed(AccountId, Hash, BlockNumber),
/// A proposal's preimage was noted, and the deposit taken.
/// A proposal's preimage was noted, and the deposit taken. [proposal_hash, who, deposit]
PreimageNoted(Hash, AccountId, Balance),
/// A proposal preimage was removed and used (the deposit was returned).
/// A proposal preimage was removed and used (the deposit was returned).
/// [proposal_hash, provider, deposit]
PreimageUsed(Hash, AccountId, Balance),
/// A proposal could not be executed because its preimage was invalid.
PreimageInvalid(Hash, ReferendumIndex),
/// A proposal could not be executed because its preimage was missing.
PreimageMissing(Hash, ReferendumIndex),
/// A registered preimage was removed and the deposit collected by the reaper (last item).
/// A registered preimage was removed and the deposit collected by the reaper.
/// [proposal_hash, provider, deposit, reaper]
PreimageReaped(Hash, AccountId, Balance, AccountId),
/// An account has been unlocked successfully.
Unlocked(AccountId),
Expand Down
6 changes: 3 additions & 3 deletions frame/elections-phragmen/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,7 @@ decl_event!(
Balance = BalanceOf<T>,
<T as frame_system::Trait>::AccountId,
{
/// A new term with new members. This indicates that enough candidates existed to run the
/// A new term with [new_members]. This indicates that enough candidates existed to run the
/// election, not that enough have has been elected. The inner value must be examined for
/// this purpose. A `NewTerm([])` indicates that some candidates got their bond slashed and
/// none were elected, whilst `EmptyTerm` means that no candidates existed to begin with.
Expand All @@ -722,8 +722,8 @@ decl_event!(
MemberKicked(AccountId),
/// A member has renounced their candidacy.
MemberRenounced(AccountId),
/// A voter (first element) was reported (byt the second element) with the the report being
/// successful or not (third element).
/// A voter was reported with the the report being successful or not.
/// [voter, reporter, success]
VoterReported(AccountId, AccountId, bool),
}
);
Expand Down
9 changes: 5 additions & 4 deletions frame/elections/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -700,13 +700,14 @@ decl_module! {

decl_event!(
pub enum Event<T> where <T as frame_system::Trait>::AccountId {
/// reaped voter, reaper
/// Reaped [voter, reaper].
VoterReaped(AccountId, AccountId),
/// slashed reaper
/// Slashed [reaper].
BadReaperSlashed(AccountId),
/// A tally (for approval votes of seat(s)) has started.
/// A tally (for approval votes of [seats]) has started.
TallyStarted(u32),
/// A tally (for approval votes of seat(s)) has ended (with one or more new members).
/// A tally (for approval votes of seat(s)) has ended (with one or more new members).
/// [incoming, outgoing]
TallyFinalized(Vec<AccountId>, Vec<AccountId>),
}
);
Expand Down
12 changes: 6 additions & 6 deletions frame/evm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,17 +201,17 @@ decl_event! {
{
/// Ethereum events from contracts.
Log(Log),
/// A contract has been created at given address.
/// A contract has been created at given [address].
Created(H160),
/// A contract was attempted to be created, but the execution failed.
/// A [contract] was attempted to be created, but the execution failed.
CreatedFailed(H160),
/// A contract has been executed successfully with states applied.
/// A [contract] has been executed successfully with states applied.
Executed(H160),
/// A contract has been executed with errors. States are reverted with only gas fees applied.
/// A [contract] has been executed with errors. States are reverted with only gas fees applied.
ExecutedFailed(H160),
/// A deposit has been made at a given address.
/// A deposit has been made at a given address. [sender, address, value]
BalanceDeposit(AccountId, H160, U256),
/// A withdrawal has been made from a given address.
/// A withdrawal has been made from a given address. [sender, address, value]
BalanceWithdraw(AccountId, H160, U256),
}
}
Expand Down
3 changes: 2 additions & 1 deletion frame/example-offchain-worker/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,8 @@ decl_storage! {
decl_event!(
/// Events generated by the module.
pub enum Event<T> where AccountId = <T as frame_system::Trait>::AccountId {
/// Event generated when new price is accepted to contribute to the average.
/// Event generated when new price is accepted to contribute to the average.
/// [price, who]
NewPrice(u32, AccountId),
}
);
Expand Down
10 changes: 5 additions & 5 deletions frame/generic-asset/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -493,15 +493,15 @@ decl_event!(
<T as Trait>::AssetId,
AssetOptions = AssetOptions<<T as Trait>::Balance, <T as frame_system::Trait>::AccountId>
{
/// Asset created (asset_id, creator, asset_options).
/// Asset created. [asset_id, creator, asset_options]
Created(AssetId, AccountId, AssetOptions),
/// Asset transfer succeeded (asset_id, from, to, amount).
/// Asset transfer succeeded. [asset_id, from, to, amount]
Transferred(AssetId, AccountId, AccountId, Balance),
/// Asset permission updated (asset_id, new_permissions).
/// Asset permission updated. [asset_id, new_permissions]
PermissionUpdated(AssetId, PermissionLatest<AccountId>),
/// New asset minted (asset_id, account, amount).
/// New asset minted. [asset_id, account, amount]
Minted(AssetId, AccountId, Balance),
/// Asset burned (asset_id, account, amount).
/// Asset burned. [asset_id, account, amount]
Burned(AssetId, AccountId, Balance),
}
);
Expand Down
9 changes: 5 additions & 4 deletions frame/identity/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -476,12 +476,13 @@ decl_event!(
JudgementGiven(AccountId, RegistrarIndex),
/// A registrar was added.
RegistrarAdded(RegistrarIndex),
/// A sub-identity (first) was added to an identity (second) and the deposit paid.
/// A sub-identity was added to an identity and the deposit paid. [sub, main, deposit]
SubIdentityAdded(AccountId, AccountId, Balance),
/// A sub-identity (first) was removed from an identity (second) and the deposit freed.
/// A sub-identity was removed from an identity and the deposit freed.
/// [sub, main, deposit]
SubIdentityRemoved(AccountId, AccountId, Balance),
/// A sub-identity (first arg) was cleared, and the given deposit repatriated from the
/// main identity account (second arg) to the sub-identity account.
/// A sub-identity was cleared, and the given deposit repatriated from the
/// main identity account to the sub-identity account. [sub, main, deposit]
SubIdentityRevoked(AccountId, AccountId, Balance),
}
);
Expand Down
2 changes: 1 addition & 1 deletion frame/im-online/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ decl_event!(
HeartbeatReceived(AuthorityId),
/// At the end of the session, no offence was committed.
AllGood,
/// At the end of the session, at least one validator was found to be offline.
/// At the end of the session, at least one validator was found to be [offline].
SomeOffline(Vec<IdentificationTuple>),
}
);
Expand Down
12 changes: 4 additions & 8 deletions frame/multisig/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,17 +197,13 @@ decl_event! {
BlockNumber = <T as system::Trait>::BlockNumber,
CallHash = [u8; 32]
{
/// A new multisig operation has begun. First param is the account that is approving,
/// second is the multisig account, third is hash of the call.
/// A new multisig operation has begun. [approving, multisig, call_hash]
NewMultisig(AccountId, AccountId, CallHash),
/// A multisig operation has been approved by someone. First param is the account that is
/// approving, third is the multisig account, fourth is hash of the call.
/// A multisig operation has been approved by someone. [approving, timepoint, multisig, call_hash]
MultisigApproval(AccountId, Timepoint<BlockNumber>, AccountId, CallHash),
/// A multisig operation has been executed. First param is the account that is
/// approving, third is the multisig account, fourth is hash of the call to be executed.
/// A multisig operation has been executed. [approving, timepoint, multisig, call_hash]
MultisigExecuted(AccountId, Timepoint<BlockNumber>, AccountId, CallHash, DispatchResult),
/// A multisig operation has been cancelled. First param is the account that is
/// cancelling, third is the multisig account, fourth is hash of the call.
/// A multisig operation has been cancelled. [cancelling, timepoint, multisig, call_hash]
MultisigCancelled(AccountId, Timepoint<BlockNumber>, AccountId, CallHash),
}
}
Expand Down
3 changes: 2 additions & 1 deletion frame/offences/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ decl_event!(
pub enum Event {
/// There is an offence reported of the given `kind` happened at the `session_index` and
/// (kind-specific) time slot. This event is not deposited for duplicate slashes. last
/// element indicates of the offence was applied (true) or queued (false).
/// element indicates of the offence was applied (true) or queued (false)
/// [kind, timeslot, applied].
Offence(Kind, OpaqueTimeSlot, bool),
}
);
Expand Down
4 changes: 2 additions & 2 deletions frame/proxy/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ decl_event! {
{
/// A proxy was executed correctly, with the given result.
ProxyExecuted(DispatchResult),
/// Anonymous account (first parameter) has been created by new proxy (second) with given
/// disambiguation index and proxy type.
/// Anonymous account has been created by new proxy with given
/// disambiguation index and proxy type. [anonymous, who, proxy_type, disambiguation_index]
AnonymousCreated(AccountId, AccountId, ProxyType, u16),
}
}
Expand Down
14 changes: 9 additions & 5 deletions frame/recovery/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,15 +264,19 @@ decl_event! {
pub enum Event<T> where
AccountId = <T as system::Trait>::AccountId,
{
/// A recovery process has been set up for an account
/// A recovery process has been set up for an account.
RecoveryCreated(AccountId),
/// A recovery process has been initiated for account_1 by account_2
/// A recovery process has been initiated for lost account by rescuer account.
/// [lost, rescuer]
RecoveryInitiated(AccountId, AccountId),
/// A recovery process for account_1 by account_2 has been vouched for by account_3
/// A recovery process for lost account by rescuer account has been vouched for by sender.
/// [lost, rescuer, sender]
RecoveryVouched(AccountId, AccountId, AccountId),
/// A recovery process for account_1 by account_2 has been closed
/// A recovery process for lost account by rescuer account has been closed.
/// [lost, rescuer]
RecoveryClosed(AccountId, AccountId),
/// Account_1 has been successfully recovered by account_2
/// Lost account has been successfully recovered by rescuer account.
/// [lost, rescuer]
AccountRecovered(AccountId, AccountId),
/// A recovery process has been removed for an account
RecoveryRemoved(AccountId),
Expand Down
3 changes: 3 additions & 0 deletions frame/scheduler/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,11 @@ decl_storage! {

decl_event!(
pub enum Event<T> where <T as system::Trait>::BlockNumber {
//Scheduled some task. [when, index]
Scheduled(BlockNumber, u32),
//Canceled some task. [when, index]
Canceled(BlockNumber, u32),
//Dispatched some task. [task, id, result]
Dispatched(TaskAddress<BlockNumber>, Option<Vec<u8>>, DispatchResult),
}
);
Expand Down
8 changes: 5 additions & 3 deletions frame/staking/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1238,11 +1238,13 @@ decl_storage! {
decl_event!(
pub enum Event<T> where Balance = BalanceOf<T>, <T as frame_system::Trait>::AccountId {
/// The era payout has been set; the first balance is the validator-payout; the second is
/// the remainder from the maximum amount of reward.
/// the remainder from the maximum amount of reward.
/// [era_index, validator_payout, remainder]
EraPayout(EraIndex, Balance, Balance),
/// The staker has been rewarded by this amount. `AccountId` is the stash account.
/// The staker has been rewarded by this amount. [stash, amount].
Reward(AccountId, Balance),
/// One validator (and its nominators) has been slashed by the given amount.
/// One validator (and its nominators) has been slashed by the given amount.
/// [validator, amount]
Slash(AccountId, Balance),
/// An old slashing report from a prior era was discarded because it could
/// not be processed.
Expand Down
2 changes: 1 addition & 1 deletion frame/sudo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ decl_event!(
Sudid(DispatchResult),
/// The sudoer just switched identity; the old key is supplied.
KeyChanged(AccountId),
/// A sudo just took place.
/// A sudo just took place. [result]
SudoAsDone(bool),
}
);
Expand Down
3 changes: 2 additions & 1 deletion frame/vesting/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,8 @@ decl_storage! {
decl_event!(
pub enum Event<T> where AccountId = <T as frame_system::Trait>::AccountId, Balance = BalanceOf<T> {
/// The amount vested has been updated. This could indicate more funds are available. The
/// balance given is the amount which is left unvested (and thus locked).
/// balance given is the amount which is left unvested (and thus locked).
/// [account, unvested]
VestingUpdated(AccountId, Balance),
/// An account (given) has become fully vested. No further vesting can happen.
VestingCompleted(AccountId),
Expand Down