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

[tests: CL Hooks]: Test hook execution order to increase coverage #6862

Open
Tracked by #5970
AlpinYukseloglu opened this issue Nov 11, 2023 · 0 comments
Open
Tracked by #5970

Comments

@AlpinYukseloglu
Copy link
Contributor

Background

It is important we ensure that the before hooks are actually executed before the after hooks in their respective function. While this is obviously correct in its current implementation, we should make sure that this is covered in tests so that future changes/additions to hook logic does not accidentally break this order.

Suggested Design

The current hook tests have a CW contract that sends 1 token with a denom corresponding to the hook trigger (e.g. beforeCreatePosition). One viable approach could be to either update this contract or make a second one where the number of tokens sent corresponds to the order the hooks were triggered.

Specifically, each hook trigger would increment a counter in state similar to in the counter test contract in x/concentrated-liquidity/testcontracts, and then assertions would be run on the specific number of tokens to ensure ordering is correct.

Acceptance Criteria

All new and existing tests pass

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Needs Triage 🔍
Development

No branches or pull requests

1 participant