From 7179567d2bc55a70d9f6763c05590253446a42c5 Mon Sep 17 00:00:00 2001 From: warfollowsme Date: Mon, 20 Jul 2020 21:30:32 +0300 Subject: [PATCH] Annotated parameter names for events --- ecosystem-modules/ren/renvm-bridge/src/lib.rs | 4 ++-- modules/airdrop/src/lib.rs | 2 ++ modules/auction_manager/src/lib.rs | 16 ++++++++-------- modules/cdp_engine/src/lib.rs | 16 ++++++++-------- modules/cdp_treasury/src/lib.rs | 10 +++++----- modules/dex/src/lib.rs | 10 +++++----- modules/emergency_shutdown/src/lib.rs | 6 +++--- modules/honzon/src/lib.rs | 6 +++--- modules/loans/src/lib.rs | 6 +++--- modules/polkadot_bridge/src/lib.rs | 1 + modules/prices/src/lib.rs | 4 ++-- modules/staking_pool/src/lib.rs | 4 ++++ 12 files changed, 46 insertions(+), 39 deletions(-) diff --git a/ecosystem-modules/ren/renvm-bridge/src/lib.rs b/ecosystem-modules/ren/renvm-bridge/src/lib.rs index 61ea9a069f..cbb44f982e 100644 --- a/ecosystem-modules/ren/renvm-bridge/src/lib.rs +++ b/ecosystem-modules/ren/renvm-bridge/src/lib.rs @@ -58,9 +58,9 @@ decl_event!( ::AccountId, DestAddress = [u8; 20], { - /// Asset minted (owner, amount) + /// Asset minted. [owner, amount] Minted(AccountId, Balance), - /// Asset burnt in this chain (owner, dest, amount) + /// Asset burnt in this chain [owner, dest, amount] Burnt(AccountId, DestAddress, Balance), } ); diff --git a/modules/airdrop/src/lib.rs b/modules/airdrop/src/lib.rs index 4eaee122dc..b687f7ed3f 100644 --- a/modules/airdrop/src/lib.rs +++ b/modules/airdrop/src/lib.rs @@ -34,7 +34,9 @@ decl_event!( AirDropCurrencyId = AirDropCurrencyId, Balance = Balance, { + /// [to, currency_id, amount] Airdrop(AccountId, AirDropCurrencyId, Balance), + /// [to, currency_id, amount] UpdateAirdrop(AccountId, AirDropCurrencyId, Balance), } ); diff --git a/modules/auction_manager/src/lib.rs b/modules/auction_manager/src/lib.rs index 3aa5103a48..1435d373b4 100644 --- a/modules/auction_manager/src/lib.rs +++ b/modules/auction_manager/src/lib.rs @@ -145,21 +145,21 @@ decl_event!( CurrencyId = CurrencyId, Balance = Balance, { - /// Create a collateral auction (auction_id, collateral_type, collateral_amount, target_bid_price) + /// Create a collateral auction. [auction_id, collateral_type, collateral_amount, target_bid_price] NewCollateralAuction(AuctionId, CurrencyId, Balance, Balance), - /// Create a debit auction (auction_id, initial_supply_amount, fix_payment_amount) + /// Create a debit auction. [auction_id, initial_supply_amount, fix_payment_amount] NewDebitAuction(AuctionId, Balance, Balance), - /// Create a surplus auction (auction_id, fix_surplus_amount) + /// Create a surplus auction. [auction_id, fix_surplus_amount] NewSurplusAuction(AuctionId, Balance), - /// Cancel a specific active auction (auction_id) + /// Cancel a specific active auction. [auction_id] CancelAuction(AuctionId), - /// Collateral auction dealed (auction_id, collateral_type, collateral_amount, winner, payment_amount). + /// Collateral auction dealed. [auction_id, collateral_type, collateral_amount, winner, payment_amount] CollateralAuctionDealed(AuctionId, CurrencyId, Balance, AccountId, Balance), - /// Surplus auction dealed (auction_id, surplus_amount, winner, payment_amount). + /// Surplus auction dealed. [auction_id, surplus_amount, winner, payment_amount] SurplusAuctionDealed(AuctionId, Balance, AccountId, Balance), - /// Debit auction dealed (auction_id, debit_currency_amount, winner, payment_amount). + /// Debit auction dealed. [auction_id, debit_currency_amount, winner, payment_amount] DebitAuctionDealed(AuctionId, Balance, AccountId, Balance), - /// Dex take collateral auction (auction_id, collateral_type, collateral_amount, turnover) + /// Dex take collateral auction. [auction_id, collateral_type, collateral_amount, turnover] DEXTakeCollateralAuction(AuctionId, CurrencyId, Balance, Balance), } ); diff --git a/modules/cdp_engine/src/lib.rs b/modules/cdp_engine/src/lib.rs index c4fd4f4043..769dcac298 100644 --- a/modules/cdp_engine/src/lib.rs +++ b/modules/cdp_engine/src/lib.rs @@ -140,21 +140,21 @@ decl_event!( CurrencyId = CurrencyId, Balance = Balance, { - /// Liquidate the unsafe CDP (collateral_type, owner, collateral_amount, bad_debt_value, liquidation_strategy) + /// Liquidate the unsafe CDP. [collateral_type, owner, collateral_amount, bad_debt_value, liquidation_strategy] LiquidateUnsafeCDP(CurrencyId, AccountId, Balance, Balance, LiquidationStrategy), - /// Settle the CDP has debit (collateral_type, owner) + /// Settle the CDP has debit. [collateral_type, owner] SettleCDPInDebit(CurrencyId, AccountId), - /// The stability fee for specific collateral type updated (collateral_type, new_stability_fee) + /// The stability fee for specific collateral type updated. [collateral_type, new_stability_fee] StabilityFeeUpdated(CurrencyId, Option), - /// The liquidation fee for specific collateral type updated (collateral_type, new_liquidation_ratio) + /// The liquidation fee for specific collateral type updated. [collateral_type, new_liquidation_ratio] LiquidationRatioUpdated(CurrencyId, Option), - /// The liquidation penalty rate for specific collateral type updated (collateral_type, new_liquidation_panelty) + /// The liquidation penalty rate for specific collateral type updated. [collateral_type, new_liquidation_panelty] LiquidationPenaltyUpdated(CurrencyId, Option), - /// The required collateral penalty rate for specific collateral type updated (collateral_type, new_required_collateral_ratio) + /// The required collateral penalty rate for specific collateral type updated. [collateral_type, new_required_collateral_ratio] RequiredCollateralRatioUpdated(CurrencyId, Option), - /// The hard cap of total debit value for specific collateral type updated (collateral_type, new_total_debit_value) + /// The hard cap of total debit value for specific collateral type updated. [collateral_type, new_total_debit_value] MaximumTotalDebitValueUpdated(CurrencyId, Balance), - /// The global stability fee for all types of collateral updated (new_global_stability_fee) + /// The global stability fee for all types of collateral updated. [new_global_stability_fee] GlobalStabilityFeeUpdated(Rate), } ); diff --git a/modules/cdp_treasury/src/lib.rs b/modules/cdp_treasury/src/lib.rs index e5ed01b842..ec2946ad7e 100644 --- a/modules/cdp_treasury/src/lib.rs +++ b/modules/cdp_treasury/src/lib.rs @@ -56,15 +56,15 @@ pub trait Trait: system::Trait { decl_event!( pub enum Event { - /// The fixed size for surplus auction updated (new_size) + /// The fixed size for surplus auction updated. [new_size] SurplusAuctionFixedSizeUpdated(Balance), - /// The buffer size of surplus pool updated (new_size) + /// The buffer size of surplus pool updated. [new_size] SurplusBufferSizeUpdated(Balance), - /// The initial supply amount of a debit auction updated (new_amount) + /// The initial supply amount of a debit auction updated. [new_amount] InitialAmountPerDebitAuctionUpdated(Balance), - /// The fixed size for debit auction updated (new_size) + /// The fixed size for debit auction updated. [new_size] DebitAuctionFixedSizeUpdated(Balance), - /// The fixed size for collateral auction under specific collateral type updated (collateral_type, new_size) + /// The fixed size for collateral auction under specific collateral type updated. [collateral_type, new_size] CollateralAuctionMaximumSizeUpdated(CurrencyId, Balance), } ); diff --git a/modules/dex/src/lib.rs b/modules/dex/src/lib.rs index 484a254f2a..57b61a4e5c 100644 --- a/modules/dex/src/lib.rs +++ b/modules/dex/src/lib.rs @@ -68,15 +68,15 @@ decl_event!( Balance = Balance, CurrencyId = CurrencyId, { - /// Add liquidity success (who, currency_type, added_currency_amount, added_base_currency_amount, increment_share_amount) + /// Add liquidity success. [who, currency_type, added_currency_amount, added_base_currency_amount, increment_share_amount] AddLiquidity(AccountId, CurrencyId, Balance, Balance, Share), - /// Withdraw liquidity from the trading pool success (who, currency_type, withdrawn_currency_amount, withdrawn_base_currency_amount, burned_share_amount) + /// Withdraw liquidity from the trading pool success. [who, currency_type, withdrawn_currency_amount, withdrawn_base_currency_amount, burned_share_amount] WithdrawLiquidity(AccountId, CurrencyId, Balance, Balance, Share), - /// Use supply currency to swap target currency (trader, supply_currency_type, supply_currency_amount, target_currency_type, target_currency_amount) + /// Use supply currency to swap target currency. [trader, supply_currency_type, supply_currency_amount, target_currency_type, target_currency_amount] Swap(AccountId, CurrencyId, Balance, CurrencyId, Balance), - /// Incentive reward rate updated (currency_type, new_rate) + /// Incentive reward rate updated. [currency_type, new_rate] LiquidityIncentiveRateUpdated(CurrencyId, Rate), - /// Incentive interest claimed (who, currency_type, amount) + /// Incentive interest claimed. [who, currency_type, amount] IncentiveInterestClaimed(AccountId, CurrencyId, Balance), } ); diff --git a/modules/emergency_shutdown/src/lib.rs b/modules/emergency_shutdown/src/lib.rs index 8b3fffd1f6..3f11d13b8f 100644 --- a/modules/emergency_shutdown/src/lib.rs +++ b/modules/emergency_shutdown/src/lib.rs @@ -55,11 +55,11 @@ decl_event!( Balance = Balance, CurrencyId = CurrencyId, { - /// Emergency shutdown occurs (block_number) + /// Emergency shutdown occurs. [block_number] Shutdown(BlockNumber), - /// The final redemption opened (block_number) + /// The final redemption opened. [block_number] OpenRefund(BlockNumber), - /// Refund info (caller, stable_coin_amount, refund_list) + /// Refund info. [caller, stable_coin_amount, refund_list] Refund(AccountId, Balance, Vec<(CurrencyId, Balance)>), } ); diff --git a/modules/honzon/src/lib.rs b/modules/honzon/src/lib.rs index 7eaff65b7b..6284fa5d03 100644 --- a/modules/honzon/src/lib.rs +++ b/modules/honzon/src/lib.rs @@ -43,11 +43,11 @@ decl_event!( ::AccountId, CurrencyId = CurrencyId, { - /// Authorize someone to operate the loan of specific collateral (authorizer, authorizee, collateral_type) + /// Authorize someone to operate the loan of specific collateral. [authorizer, authorizee, collateral_type] Authorization(AccountId, AccountId, CurrencyId), - /// Cancel the authorization of specific collateral for someone (authorizer, authorizee, collateral_type) + /// Cancel the authorization of specific collateral for someone. [authorizer, authorizee, collateral_type] UnAuthorization(AccountId, AccountId, CurrencyId), - /// Cancel all authorization (authorizer) + /// Cancel all authorization. [authorizer] UnAuthorizationAll(AccountId), } ); diff --git a/modules/loans/src/lib.rs b/modules/loans/src/lib.rs index 02d7377454..ce300249b6 100644 --- a/modules/loans/src/lib.rs +++ b/modules/loans/src/lib.rs @@ -88,11 +88,11 @@ decl_event!( Balance = Balance, CurrencyId = CurrencyId, { - /// Position updated (owner, collateral_type, collateral_adjustment, debit_adjustment) + /// Position updated. [owner, collateral_type, collateral_adjustment, debit_adjustment] PositionUpdated(AccountId, CurrencyId, Amount, DebitAmount), - /// Confiscate CDP's collateral assets and eliminate its debit (owner, collateral_type, confiscated_collateral_amount, deduct_debit_amount) + /// Confiscate CDP's collateral assets and eliminate its debit. [owner, collateral_type, confiscated_collateral_amount, deduct_debit_amount] ConfiscateCollateralAndDebit(AccountId, CurrencyId, Balance, DebitBalance), - /// Transfer loan (from, to) + /// Transfer loan. [from, to, currency_id] TransferLoan(AccountId, AccountId, CurrencyId), } ); diff --git a/modules/polkadot_bridge/src/lib.rs b/modules/polkadot_bridge/src/lib.rs index e0185ea5df..9387981964 100644 --- a/modules/polkadot_bridge/src/lib.rs +++ b/modules/polkadot_bridge/src/lib.rs @@ -30,6 +30,7 @@ decl_event!( ::AccountId, Balance = Balance, { + /// [account, amount] Mint(AccountId, Balance), } ); diff --git a/modules/prices/src/lib.rs b/modules/prices/src/lib.rs index e88ae59611..b6652e0bcb 100644 --- a/modules/prices/src/lib.rs +++ b/modules/prices/src/lib.rs @@ -52,9 +52,9 @@ pub trait Trait: system::Trait { decl_event!( pub enum Event { - /// Lock price (currency_id, locked_price) + /// Lock price. [currency_id, locked_price] LockPrice(CurrencyId, Price), - /// Unlock price (currency_id) + /// Unlock price. [currency_id] UnlockPrice(CurrencyId), } ); diff --git a/modules/staking_pool/src/lib.rs b/modules/staking_pool/src/lib.rs index c20c1ede57..b9bc2fd8d8 100644 --- a/modules/staking_pool/src/lib.rs +++ b/modules/staking_pool/src/lib.rs @@ -46,9 +46,13 @@ decl_event!( ::AccountId, Balance = Balance, { + /// [account, bond, mint] BondAndMint(AccountId, Balance, Balance), + /// [who, redeem_amount] RedeemByUnbond(AccountId, Balance), + /// [who, fee, redeem_amount, unbond_amount] RedeemByFreeUnbonded(AccountId, Balance, Balance, Balance), + /// [who, target_era, fee, redeem_amount, unbond_amount] RedeemByClaimUnbonding(AccountId, EraIndex, Balance, Balance, Balance), } );