Conversation
|
|
||
| for _, test := range tests { | ||
| suite.SetupTest() | ||
| suite.Run(test.name, func() { |
There was a problem hiding this comment.
Note to reviewers: the diff is large because of indentation change due to suite.Run
x/gamm/keeper/msg_server_test.go
Outdated
| shareInAmount: sdk.NewInt(shareOut), | ||
| tokenOutMins: sdk.NewCoins(), | ||
| expectedRemoveLiquidityEvents: 1, | ||
| expectedMessageEvents: 3, // 1 gamm + 2 tendermint. |
There was a problem hiding this comment.
just for my learning, why are there two TM messages emitted here?
There was a problem hiding this comment.
These are not TM, the comment is wrong, and I'm going to change this. This happens because other keeper methods emit these events. For example, bank send:
https://github.com/cosmos/cosmos-sdk/blob/71035879e4af4551b9bcf16f79bc52785793602e/x/bank/keeper/send.go#L213-L215
I think the bank send is wrong and should instead have its message emitted in the message server so that we don't triple-count it here.
Co-authored-by: Adam Tucker <adam@osmosis.team>
Co-authored-by: Adam Tucker <adam@osmosis.team>
Co-authored-by: Adam Tucker <adam@osmosis.team>
|
Planning on merging this once CI passes. All comments are addressed and no API or state-breaking changes |
Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com>
* test(x/gamm): remove liquidity events * remove capacity pre-allocation * Update x/gamm/keeper/internal/events/emit_test.go Co-authored-by: Adam Tucker <adam@osmosis.team> * Update x/gamm/keeper/msg_server_test.go Co-authored-by: Adam Tucker <adam@osmosis.team> * Update x/gamm/keeper/pool_service_test.go Co-authored-by: Adam Tucker <adam@osmosis.team> * shareIn * update event comments * changelog * Update CHANGELOG.md Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com> * add docs Co-authored-by: Adam Tucker <adam@osmosis.team> Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com> (cherry picked from commit 40f19a3) # Conflicts: # CHANGELOG.md # x/gamm/keeper/pool_service_test.go # x/superfluid/keeper/unpool_test.go
Part of: #1942
What is the purpose of the change
Tests remove liquidity events that should be emitted when a pool is exited.
Similarly to #2141, I noticed that they were emitted twice:
I removed 1. while keeping 2.
No breaking changes.
Passthrough changes
AssertEventEmittedtest helper to be defined on the suite. It is also useful for testing events in other modulesctxsuite.Run()to some table-driven testsTesting and Verifying
Documentation and Release Note
Unreleasedsection inCHANGELOG.md? no