Skip to content

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

@zsystm

Description

@zsystm

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions