cleanup cdp events

This commit is contained in:
Kevin Davis 2020-05-07 17:35:42 -04:00
parent fd8d48e208
commit db7aaef98d
4 changed files with 17 additions and 12 deletions

View File

@ -22,7 +22,7 @@ const (
EventTypeCdpLiquidation = types.EventTypeCdpLiquidation EventTypeCdpLiquidation = types.EventTypeCdpLiquidation
EventTypeBeginBlockerFatal = types.EventTypeBeginBlockerFatal EventTypeBeginBlockerFatal = types.EventTypeBeginBlockerFatal
AttributeKeyCdpID = types.AttributeKeyCdpID AttributeKeyCdpID = types.AttributeKeyCdpID
AttributeKeyDepositor = types.AttributeKeyDepositor AttributeKeyDeposit = types.AttributeKeyDeposit
AttributeValueCategory = types.AttributeValueCategory AttributeValueCategory = types.AttributeValueCategory
AttributeKeyError = types.AttributeKeyError AttributeKeyError = types.AttributeKeyError
ModuleName = types.ModuleName ModuleName = types.ModuleName

View File

@ -40,7 +40,7 @@ func (k Keeper) SeizeCollateral(ctx sdk.Context, cdp types.CDP) error {
types.EventTypeCdpLiquidation, types.EventTypeCdpLiquidation,
sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory),
sdk.NewAttribute(types.AttributeKeyCdpID, fmt.Sprintf("%d", cdp.ID)), sdk.NewAttribute(types.AttributeKeyCdpID, fmt.Sprintf("%d", cdp.ID)),
sdk.NewAttribute(types.AttributeKeyDepositor, fmt.Sprintf("%s", dep.Depositor)), sdk.NewAttribute(types.AttributeKeyDeposit, dep.String()),
), ),
) )
err := k.supplyKeeper.SendCoinsFromModuleToModule(ctx, types.ModuleName, types.LiquidatorMacc, sdk.NewCoins(dep.Amount)) err := k.supplyKeeper.SendCoinsFromModuleToModule(ctx, types.ModuleName, types.LiquidatorMacc, sdk.NewCoins(dep.Amount))

View File

@ -18,10 +18,12 @@ The cdp module emits the following events:
### MsgWithdraw ### MsgWithdraw
| Type | Attribute Key | Attribute Value | | Type | Attribute Key | Attribute Value |
|---------|---------------|------------------| |---------|--------------- |-----------------------|
| message | module | cdp | | message | cdp_withdrawal | {collateral amount} |
| message | sender | {sender address} | | message | cdp_id | {cdp_id} |
| message | module | cdp |
| message | sender | {sender address} |
### MsgDeposit ### MsgDeposit
@ -43,10 +45,13 @@ The cdp module emits the following events:
### MsgRepayDebt ### MsgRepayDebt
| Type | Attribute Key | Attribute Value | | Type | Attribute Key | Attribute Value |
|---------|---------------|------------------| |---------------|---------------|--------------------|
| message | module | cdp | | cdp_repayment | amount | {repayment amount} |
| message | sender | {sender address} | | cdp_repayment | cdp_id | {cdp id} |
| cdp_close | cdp_id | {cdp id} |
| message | module | cdp |
| message | sender | {sender address} |
## BeginBlock ## BeginBlock
@ -54,6 +59,6 @@ The cdp module emits the following events:
|-------------------------|---------------|---------------------| |-------------------------|---------------|---------------------|
| cdp_liquidation | module | cdp | | cdp_liquidation | module | cdp |
| cdp_liquidation | cdp_id | {cdp id} | | cdp_liquidation | cdp_id | {cdp id} |
| cdp_liquidation | depositor | {depositor address} | | cdp_liquidation | deposit | {deposit} |
| cdp_begin_blocker_error | module | cdp | | cdp_begin_blocker_error | module | cdp |
| cdp_begin_blocker_error | error_message | {error} | | cdp_begin_blocker_error | error_message | {error} |

View File

@ -12,7 +12,7 @@ const (
EventTypeBeginBlockerFatal = "cdp_begin_block_error" EventTypeBeginBlockerFatal = "cdp_begin_block_error"
AttributeKeyCdpID = "cdp_id" AttributeKeyCdpID = "cdp_id"
AttributeKeyDepositor = "depositor" AttributeKeyDeposit = "deposit"
AttributeValueCategory = "cdp" AttributeValueCategory = "cdp"
AttributeKeyError = "error_message" AttributeKeyError = "error_message"
) )