Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/lockup: Ensure events are emitted and tests added #2270

Closed
stackman27 opened this issue Aug 2, 2022 · 2 comments
Closed

x/lockup: Ensure events are emitted and tests added #2270

stackman27 opened this issue Aug 2, 2022 · 2 comments
Assignees

Comments

@stackman27
Copy link
Contributor

stackman27 commented Aug 2, 2022

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
@osmo-bot osmo-bot moved this to Needs Review 🔍 in Osmosis Chain Development Aug 2, 2022
@stackman27 stackman27 changed the title x/lockup: ensure events are emitted and tests added x/lockup: Ensure events are emitted and tests added Aug 2, 2022
@stackman27
Copy link
Contributor Author

Epic #2195

@ValarDragon
Copy link
Member

See PR discussion

Repository owner moved this from Needs Review 🔍 to Done ✅ in Osmosis Chain Development Sep 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants