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/gamm: test that swap and LP events are emitted #1942

Closed
3 of 5 tasks
p0mvn opened this issue Jul 1, 2022 · 4 comments
Closed
3 of 5 tasks

x/gamm: test that swap and LP events are emitted #1942

p0mvn opened this issue Jul 1, 2022 · 4 comments
Assignees
Labels
C:x/gamm Changes, features and bugs related to the gamm module. T:dev-UX T:story A story belongs to an epic

Comments

@p0mvn
Copy link
Member

p0mvn commented Jul 1, 2022

Background

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

Therefore, this issue is twofold:

  1. Investigate if / which events are missing and restore them
  2. Add assertions in tests that events are being emitted in the correct places

Acceptance Criteria

  • all events are in the right places
    • swap events:
    • pool joined
    • pool exited
    • pool created
    • msg events
  • consider emitting all events from the message server
  • assertions in unit tests are added
  • all unit tests continue to pass
@p0mvn p0mvn added C:x/gamm Changes, features and bugs related to the gamm module. T:dev-UX labels Jul 1, 2022
@ValarDragon ValarDragon moved this to Needs Review 🔍 in Osmosis Chain Development Jul 1, 2022
@p0mvn
Copy link
Member Author

p0mvn commented Jul 1, 2022

I have some progress started here: https://github.com/osmosis-labs/osmosis/tree/roman/gamm-events

@p0mvn p0mvn changed the title x/gamm: test that events are emitted x/gamm: test that swap and LP events are emitted Jul 1, 2022
@p0mvn p0mvn self-assigned this Jul 1, 2022
@p0mvn p0mvn moved this from Needs Review 🔍 to In Progress🏃 in Osmosis Chain Development Jul 20, 2022
@p0mvn
Copy link
Member Author

p0mvn commented Jul 21, 2022

@mattverse following up on your comment in one of the gamm event PRs. After doing some investigation, I think we should not move the logic for emitting swap and liquidity events to the message server.

The reason is that some gamm keeper methods might be called from other modules. For example, superfluid:

exitedCoins, err := k.gk.ExitPool(ctx, sender, poolId, gammSharesInLock.Amount, minOutCoins)

If we were emitting events in the message server, the remove liquidity event would not be emitted. Therefore, I think it makes sense to keep the locations as is and thoroughly test.

@mattverse
Copy link
Member

good point! Agreed 😎

@p0mvn p0mvn added the T:story A story belongs to an epic label Jul 22, 2022
@p0mvn p0mvn moved this from In Progress🏃 to Todo 🕒 in Osmosis Chain Development Aug 29, 2022
@ValarDragon
Copy link
Member

Pretty sure this got completed!

@github-project-automation github-project-automation bot moved this from Todo 🕒 to Done ✅ in Osmosis Chain Development Jan 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C:x/gamm Changes, features and bugs related to the gamm module. T:dev-UX T:story A story belongs to an epic
Projects
Archived in project
Development

No branches or pull requests

3 participants