Skip to content

Improve Test Coverage for State Transitions in Precompile Contract Tests #91

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

Open
zsystm opened this issue Apr 17, 2025 · 0 comments
Open

Comments

@zsystm
Copy link

zsystm commented Apr 17, 2025

While reviewing current test cases in precompiles/staking/integration_test.go, it became clear that many of them do not thoroughly verify whether state transitions have occurred as expected — particularly in terms of balance changes and other side effects.

For example, in delegate test cases, we currently do not check whether the delegator’s balance has decreased after delegation. This pattern appears in several other tests as well.

Since the precompiled contract performs relatively complex state transitions, it would be valuable to strengthen test coverage by:

  • Adding explicit balance checks before and after state-modifying operations (e.g., delegate, undelegate, redelegate)
  • Verifying other relevant state changes, such as updates to staking or vesting state
  • Ensuring all critical invariants are maintained post-execution

This issue is to track the effort of improving these test cases incrementally, either as a dedicated PR or progressively alongside other changes.

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

No branches or pull requests

1 participant