From ae1dba93636e7536ca8f49cfc80539460383751a Mon Sep 17 00:00:00 2001 From: Xiliang Chen Date: Tue, 13 Jul 2021 22:16:00 +1200 Subject: [PATCH] Update event name mapping (#1203) * update event name * fix --- modules/auction-manager/src/lib.rs | 1 + modules/cdp-engine/src/lib.rs | 1 + modules/collator-selection/src/lib.rs | 7 ++++++- modules/currencies/src/lib.rs | 9 +++++---- modules/dex/src/lib.rs | 1 + modules/emergency-shutdown/src/lib.rs | 1 + modules/evm-accounts/src/lib.rs | 1 + modules/evm/src/lib.rs | 1 + modules/homa-validator-list/src/lib.rs | 1 + modules/honzon/src/lib.rs | 1 + modules/incentives/src/lib.rs | 1 + modules/loans/src/lib.rs | 1 + modules/nft/src/lib.rs | 1 + modules/nominees-election/src/lib.rs | 3 ++- modules/staking-pool/src/lib.rs | 1 + orml | 2 +- 16 files changed, 26 insertions(+), 7 deletions(-) diff --git a/modules/auction-manager/src/lib.rs b/modules/auction-manager/src/lib.rs index 39ab14cf9a..0249adeecf 100644 --- a/modules/auction-manager/src/lib.rs +++ b/modules/auction-manager/src/lib.rs @@ -195,6 +195,7 @@ pub mod module { #[pallet::event] #[pallet::generate_deposit(pub(crate) fn deposit_event)] + #[pallet::metadata(T::AccountId = "AccountId")] pub enum Event { /// Collateral auction created. \[auction_id, collateral_type, /// collateral_amount, target_bid_price\] diff --git a/modules/cdp-engine/src/lib.rs b/modules/cdp-engine/src/lib.rs index 8c053c6266..162bc90115 100644 --- a/modules/cdp-engine/src/lib.rs +++ b/modules/cdp-engine/src/lib.rs @@ -213,6 +213,7 @@ pub mod module { #[pallet::event] #[pallet::generate_deposit(pub(crate) fn deposit_event)] + #[pallet::metadata(T::AccountId = "AccountId", Option = "OptionRate", Option = "OptionRatio")] pub enum Event { /// Liquidate the unsafe CDP. \[collateral_type, owner, /// collateral_amount, bad_debt_value, liquidation_strategy\] diff --git a/modules/collator-selection/src/lib.rs b/modules/collator-selection/src/lib.rs index 199e1b8e4f..fef9f53182 100644 --- a/modules/collator-selection/src/lib.rs +++ b/modules/collator-selection/src/lib.rs @@ -233,13 +233,18 @@ pub mod pallet { } #[pallet::event] - #[pallet::metadata(T::AccountId = "AccountId", BalanceOf = "Balance")] #[pallet::generate_deposit(pub(super) fn deposit_event)] + #[pallet::metadata(T::AccountId = "AccountId", Vec = "Vec", BalanceOf = "Balance")] pub enum Event { + /// Invulnurable was updated. \[new_invulnerables\] NewInvulnerables(Vec), + /// Desired candidates was updated. \[new_desired_candidates\] NewDesiredCandidates(u32), + /// Candidacy bond was updated. \[new_candidacy_bond\] NewCandidacyBond(BalanceOf), + /// A candidate was added. \[who, bond\] CandidateAdded(T::AccountId, BalanceOf), + /// A candidate was removed. \[who\] CandidateRemoved(T::AccountId), } diff --git a/modules/currencies/src/lib.rs b/modules/currencies/src/lib.rs index 0575a9054b..f97a8212c4 100644 --- a/modules/currencies/src/lib.rs +++ b/modules/currencies/src/lib.rs @@ -106,14 +106,15 @@ pub mod module { #[pallet::event] #[pallet::generate_deposit(pub(crate) fn deposit_event)] + #[pallet::metadata(T::AccountId = "AccountId", BalanceOf = "Balance", CurrencyIdOf = "CurrencyId")] pub enum Event { - /// Currency transfer success. [currency_id, from, to, amount] + /// Currency transfer success. \[currency_id, from, to, amount\] Transferred(CurrencyIdOf, T::AccountId, T::AccountId, BalanceOf), - /// Update balance success. [currency_id, who, amount] + /// Update balance success. \[currency_id, who, amount\] BalanceUpdated(CurrencyIdOf, T::AccountId, AmountOf), - /// Deposit success. [currency_id, who, amount] + /// Deposit success. \[currency_id, who, amount\] Deposited(CurrencyIdOf, T::AccountId, BalanceOf), - /// Withdraw success. [currency_id, who, amount] + /// Withdraw success. \[currency_id, who, amount\] Withdrawn(CurrencyIdOf, T::AccountId, BalanceOf), } diff --git a/modules/dex/src/lib.rs b/modules/dex/src/lib.rs index 1bb0422ed3..33cd7ddc41 100644 --- a/modules/dex/src/lib.rs +++ b/modules/dex/src/lib.rs @@ -172,6 +172,7 @@ pub mod module { #[pallet::event] #[pallet::generate_deposit(pub(crate) fn deposit_event)] + #[pallet::metadata(T::AccountId = "AccountId")] pub enum Event { /// add provision success \[who, currency_id_0, contribution_0, /// currency_id_1, contribution_1\] diff --git a/modules/emergency-shutdown/src/lib.rs b/modules/emergency-shutdown/src/lib.rs index 5cc25fccbf..3bb003c6c5 100644 --- a/modules/emergency-shutdown/src/lib.rs +++ b/modules/emergency-shutdown/src/lib.rs @@ -92,6 +92,7 @@ pub mod module { #[pallet::event] #[pallet::generate_deposit(fn deposit_event)] + #[pallet::metadata(T::AccountId = "AccountId", T::BlockNumber = "BlockNumber")] pub enum Event { /// Emergency shutdown occurs. \[block_number\] Shutdown(T::BlockNumber), diff --git a/modules/evm-accounts/src/lib.rs b/modules/evm-accounts/src/lib.rs index e0165dcbd3..6f53708956 100644 --- a/modules/evm-accounts/src/lib.rs +++ b/modules/evm-accounts/src/lib.rs @@ -80,6 +80,7 @@ pub mod module { #[pallet::event] #[pallet::generate_deposit(fn deposit_event)] + #[pallet::metadata(T::AccountId = "AccountId")] pub enum Event { /// Mapping between Substrate accounts and EVM accounts /// claim account. \[account_id, evm_address\] diff --git a/modules/evm/src/lib.rs b/modules/evm/src/lib.rs index f9c25dee86..e331f627d5 100644 --- a/modules/evm/src/lib.rs +++ b/modules/evm/src/lib.rs @@ -376,6 +376,7 @@ pub mod module { /// EVM events #[pallet::event] #[pallet::generate_deposit(pub(crate) fn deposit_event)] + #[pallet::metadata(T::AccountId = "AccountId")] pub enum Event { /// Ethereum events from contracts. Log(Log), diff --git a/modules/homa-validator-list/src/lib.rs b/modules/homa-validator-list/src/lib.rs index 6362ede04f..12404f9f1c 100644 --- a/modules/homa-validator-list/src/lib.rs +++ b/modules/homa-validator-list/src/lib.rs @@ -211,6 +211,7 @@ pub mod module { #[pallet::event] #[pallet::generate_deposit(pub(crate) fn deposit_event)] + #[pallet::metadata(T::AccountId = "AccountId", T::RelaychainAccountId = "RelaychainAccountId")] pub enum Event { FreezeValidator(T::RelaychainAccountId), ThawValidator(T::RelaychainAccountId), diff --git a/modules/honzon/src/lib.rs b/modules/honzon/src/lib.rs index 6215fd75bd..bdfc96483a 100644 --- a/modules/honzon/src/lib.rs +++ b/modules/honzon/src/lib.rs @@ -85,6 +85,7 @@ pub mod module { #[pallet::event] #[pallet::generate_deposit(fn deposit_event)] + #[pallet::metadata(T::AccountId = "AccountId")] pub enum Event { /// Authorize someone to operate the loan of specific collateral. /// \[authorizer, authorizee, collateral_type\] diff --git a/modules/incentives/src/lib.rs b/modules/incentives/src/lib.rs index 49cc5c2592..2dde051bea 100644 --- a/modules/incentives/src/lib.rs +++ b/modules/incentives/src/lib.rs @@ -169,6 +169,7 @@ pub mod module { #[pallet::event] #[pallet::generate_deposit(pub(crate) fn deposit_event)] + #[pallet::metadata(T::AccountId = "AccountId", PoolId = "PoolId")] pub enum Event { /// Deposit DEX share. \[who, dex_share_type, deposit_amount\] DepositDexShare(T::AccountId, CurrencyId, Balance), diff --git a/modules/loans/src/lib.rs b/modules/loans/src/lib.rs index de6114840a..9382769ffc 100644 --- a/modules/loans/src/lib.rs +++ b/modules/loans/src/lib.rs @@ -94,6 +94,7 @@ pub mod module { #[pallet::event] #[pallet::generate_deposit(pub(crate) fn deposit_event)] + #[pallet::metadata(T::AccountId = "AccountId")] pub enum Event { /// Position updated. \[owner, collateral_type, collateral_adjustment, /// debit_adjustment\] diff --git a/modules/nft/src/lib.rs b/modules/nft/src/lib.rs index b71fd4bdef..b22afd5bb0 100644 --- a/modules/nft/src/lib.rs +++ b/modules/nft/src/lib.rs @@ -163,6 +163,7 @@ pub mod module { #[pallet::event] #[pallet::generate_deposit(pub(crate) fn deposit_event)] + #[pallet::metadata(T::AccountId = "AccountId", ClassIdOf = "ClassId", TokenIdOf = "TokenId", T::Hash = "Hash")] pub enum Event { /// Created NFT class. \[owner, class_id\] CreatedClass(T::AccountId, ClassIdOf), diff --git a/modules/nominees-election/src/lib.rs b/modules/nominees-election/src/lib.rs index 23b410b4ae..2739f598be 100644 --- a/modules/nominees-election/src/lib.rs +++ b/modules/nominees-election/src/lib.rs @@ -168,8 +168,9 @@ pub mod module { #[pallet::event] #[pallet::generate_deposit(pub(crate) fn deposit_event)] + #[pallet::metadata(T::AccountId = "AccountId")] pub enum Event, I: 'static = ()> { - /// rebond. [who, amount] + /// rebond. \[who, amount\] Rebond(T::AccountId, Balance), } diff --git a/modules/staking-pool/src/lib.rs b/modules/staking-pool/src/lib.rs index b21ff99c72..345610def4 100644 --- a/modules/staking-pool/src/lib.rs +++ b/modules/staking-pool/src/lib.rs @@ -202,6 +202,7 @@ pub mod module { #[pallet::event] #[pallet::generate_deposit(pub(crate) fn deposit_event)] + #[pallet::metadata(T::AccountId = "AccountId")] pub enum Event { /// Deposit staking currency(DOT) to staking pool and issue liquid /// currency(LDOT). \[who, staking_amount_deposited, diff --git a/orml b/orml index 51341d9286..3d64077e5a 160000 --- a/orml +++ b/orml @@ -1 +1 @@ -Subproject commit 51341d928687ef0b5fd8b038d307eade715a7fe2 +Subproject commit 3d64077e5ac5539bde336a794308d85f6f5f2b82