Skip to content

Test that locked and vested always sum to the total #185

Description

@Glittersup

Summary

locked and vested are complementary views of the same stream, so their sum should equal total_amount at any point in time. Asserting the invariant directly catches a whole class of arithmetic mistakes that individual boundary tests can miss.

Acceptance criteria

  • A test asserts locked plus vested equals the stream total at several points in time.
  • The invariant is checked before the cliff, mid-stream, and after the end.
  • The suite still passes.

Getting started

Fork this repository, clone your fork, and add this repo as upstream:

git clone https://github.com/<your-username>/tricklepay-contracts.git
cd tricklepay-contracts
git remote add upstream https://github.com/TricklePay/tricklepay-contracts.git

Create a branch for this issue:

git checkout -b test/issue-185

Suggested commit message:

test: assert locked and vested sum to the total

Run cargo fmt --check, cargo clippy --all-targets -- -D warnings, and cargo test before opening a pull request and linking this issue.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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