osmosis
osmosis copied to clipboard
x/gamm: test that swap and LP events are emitted
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:
- Investigate if / which events are missing and restore them
- Add assertions in tests that events are being emitted in the correct places
Acceptance Criteria
- all events are in the right places
- [x] swap events:
- [x] pool joined
- [x] 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
I have some progress started here: https://github.com/osmosis-labs/osmosis/tree/roman/gamm-events
@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: https://github.com/osmosis-labs/osmosis/blob/4970f165f439ad43c8a188e056b4ad69f54aebb4/x/superfluid/keeper/unpool.go#L60
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.
good point! Agreed 😎
Pretty sure this got completed!