osmosis icon indicating copy to clipboard operation
osmosis copied to clipboard

x/lockup: Ensure events are emitted and tests added

Open stackman27 opened this issue 2 years ago • 1 comments

Background

Currently, our tests are missing assertions about events. Moreover, it seems that some of our events are missing based on #1939

The lockup module emits the following events:

There are 4 types of events that exist in lockup module:

* `types.TypeEvtLockTokens` - "lock_tokens"
* `types.TypeEvtAddTokensToLock` - "add_tokens_to_lock"
* `types.TypeEvtBeginUnlockAll` - "begin_unlock_all"
* `types.TypeEvtBeginUnlock` - "begin_unlock"

### `types.TypeEvtLockTokens`

* `types.AttributePeriodLockID`
* `types.AttributePeriodLockOwner`
* `types.AttributePeriodLockAmount`
* `types.AttributePeriodLockDuration`
* `types.AttributePeriodLockUnlockTime`

### `types.TypeEvtAddTokensToLock`

* `types.AttributePeriodLockID` 
* `types.AttributePeriodLockOwner`
* `types.AttributePeriodLockAmount`

### `types.TypeEvtBeginUnlockAll`

* `types.AttributePeriodLockOwner`
* `types.AttributeUnlockedCoins`

### `types.TypeEvtBeginUnlock`

* `types.AttributePeriodLockID`
* `types.AttributePeriodLockOwner`
* `types.AttributePeriodLockDuration`
* `types.AttributePeriodLockUnlockTime`

Therefore, this issue is twofold:

  • Investigate if / which events are missing and restore them

  • Add assertions in tests that events are being emitted in the correct places

Suggested Design

Very similar to what @p0mvn suggested for superfluid events! #2194

Acceptance Criteria

  • lockup events are emitted correctly in the right locations
  • tests added for attributes
  • tests added for verifying that events are emitted in the correct locations
  • every event is documented in lockup README
    • what the events is for / when it is emitted
    • what attributes it contains
  • final design is consistent with x/gamm and x/superfluid events

stackman27 avatar Aug 02 '22 07:08 stackman27

Epic #2195

stackman27 avatar Aug 02 '22 07:08 stackman27

See PR discussion

ValarDragon avatar Sep 26 '22 09:09 ValarDragon