osmosis
osmosis copied to clipboard
x/gamm: Add PoolI mocks and test for inactive pools
Closes: #2062
What is the purpose of the change
Following up to #2050, add tests to ensure swaps fail when IsActive returns false. Requires mocking out the PoolI interface, so used gomock package for as per suggestion in https://github.com/osmosis-labs/osmosis/issues/1904#issuecomment-1182730437.
Brief Changelog
gomockpackage ingo.modmock_pool.gomodule for mockedPoolIinterface- Added new test for inactive pool swaps in
swap_tests.go
Testing and Verifying
This change added tests and can be verified as follows:
- Extended
swap_tests.goby addingTestInactivePoolFreezeSwaps
Documentation and Release Note
- Does this pull request introduce a new feature or user-facing behavior changes? (no)
- Is a relevant changelog entry added to the
Unreleasedsection inCHANGELOG.md? (no) - How is the feature or change documented? (not applicable, also generated mock files are somewhat self-documenting)
@mattverse thanks for the suggestions, addressed your comments! Lmk if you want me to add anything about gomock in any documentation.
Hi @rrrliu . Great work on this PR! Just wanted to check in and see if you have time to address the last 2 suggestions. We can merge this right after :rocket:
Hi @rrrliu . Great work on this PR! Just wanted to check in and see if you have time to address the last 2 suggestions. We can merge this right after 🚀
Just pushed -- sorry for the long turnaround!
@rrrliu thanks and np! Seems that there is a CI failure due to merge conflict, do you mind fixing that test, please? We can merge this right after