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
EventTypeBeginBlockerFatal = types.EventTypeBeginBlockerFatal
AttributeKeyCdpID = types.AttributeKeyCdpID
AttributeKeyDepositor = types.AttributeKeyDepositor
AttributeKeyDeposit = types.AttributeKeyDeposit
AttributeValueCategory = types.AttributeValueCategory
AttributeKeyError = types.AttributeKeyError
ModuleName = types.ModuleName

View File

@ -40,7 +40,7 @@ func (k Keeper) SeizeCollateral(ctx sdk.Context, cdp types.CDP) error {
types.EventTypeCdpLiquidation,
sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory),
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))

View File

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

View File

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