Skip to content

Comments

TEST-4 enrich tests#463

Merged
mtabasco merged 2 commits intofix/test-update-cluster-balance-on-liquidated-clustersfrom
TEST-4-fix
Feb 25, 2026
Merged

TEST-4 enrich tests#463
mtabasco merged 2 commits intofix/test-update-cluster-balance-on-liquidated-clustersfrom
TEST-4-fix

Conversation

@mtabasco
Copy link
Contributor

Before (Integration Tests):
❌ Used greaterThan, lessThan, greaterThanOrEqual (11 violations)
❌ Used "tolerance" pattern allowing 100 wei rounding error
❌ Didn't track block numbers for precise calculations
After (Integration Tests):
✅ All assertions use exact .to.equal() with calculated expected values
✅ Block numbers tracked precisely for fee calculations
✅ Every balance assertion references SPEC.md formulas

Added 3 New Edge Case Tests:
File: test/unit/SSVClusters/updateClusterBalance.test.ts
Test 1: Multi-Validator Liquidated Cluster (Lines 463-527)
Test 2: EB Decrease on Liquidated Cluster (Lines 529-602)
Test 3: Implicit→Explicit EB Transition (Lines 604-653)

@mtabasco mtabasco requested a review from yurii-ssv February 25, 2026 14:52
@mtabasco mtabasco changed the title chore: enrich tests TEST-4 enrich tests Feb 25, 2026

return {
cluster, validatorKey, operatorIds
cluster, validatorKey, operatorIds, receiptRegister
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yurii-ssv do you think adding tx receipt here is useful? I only use it to get the block number in one test...

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, why not. Can be very helpful when we will start addressing #435

@github-actions
Copy link

github-actions bot commented Feb 25, 2026

Gas Usage Report

Commit: 1c65d2c
Branch: HEAD
All within limits: Yes

All operations are within gas limits.

@mtabasco mtabasco merged commit 98936b7 into fix/test-update-cluster-balance-on-liquidated-clusters Feb 25, 2026
7 checks passed
@mtabasco mtabasco deleted the TEST-4-fix branch February 25, 2026 15:48
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.

2 participants