Skip to content

test(contract): boundary timestamp tests for exact unlock_at and expires_at ledger times - #66

Open
jdjioe5-cpu wants to merge 1 commit into
Kinlock-Org:mainfrom
jdjioe5-cpu:test/issue-58-boundary-timestamp-tests
Open

jdjioe5-cpu wants to merge 1 commit into
Kinlock-Org:mainfrom
jdjioe5-cpu:test/issue-58-boundary-timestamp-tests

Conversation

@jdjioe5-cpu

Copy link
Copy Markdown

Resolves #58.

Summary

Adds comprehensive unit tests in contracts/kinlock/src/test/vault_tests.rs asserting exact second boundary transitions for lock releases and refunds as specified by Hard Rule 8 and issue #58:

  • now == unlock_at - 1: release fails with Error::TrancheNotUnlocked.
  • now == unlock_at: release succeeds.
  • now == expires_at - 1: release succeeds, while refund fails with Error::RefundNotAllowed.
  • now == expires_at: release fails with Error::LockExpired, while refund succeeds with RefundReason::Expired.
  • Verified across single-tranche payee locks, two-tranche payee locks (partial release followed by expiry refund of remainder), and universal direct locks (create_direct_lock).

Roadmap update

Updated ROADMAP.md tracking M1-07 and M1-13 boundary tests with closes #58.

Verification

  • cargo fmt --all -- --check: PASS
  • cargo clippy --all-targets -- -D warnings: PASS
  • cargo test --package kinlock: PASS (all 115 tests green)

Payout: USDC on base
Recipient address: 0xb5C01dc3d7878B6cc97511B079a7FAA18473453C

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

Successfully merging this pull request may close these issues.

test(contract): boundary timestamp tests for exact unlock_at and expires_at ledger times

2 participants