Skip to content

test(types): add unit tests for PruningConfig enabled and effective_min_height#61

Open
lau90eth wants to merge 1 commit into
circlefin:mainfrom
lau90eth:lau90eth/test-pruning-config
Open

test(types): add unit tests for PruningConfig enabled and effective_min_height#61
lau90eth wants to merge 1 commit into
circlefin:mainfrom
lau90eth:lau90eth/test-pruning-config

Conversation

@lau90eth
Copy link
Copy Markdown

Summary

Add unit tests for PruningConfig to improve test coverage.

The PruningConfig struct had 0% test coverage. These tests verify:

  • enabled() returns false by default
  • enabled() returns true when certificates_distance > 0
  • enabled() returns true when certificates_before > Height::new(0)
  • effective_certificates_min_height() prefers certificates_before over certificates_distance
  • effective_certificates_min_height() correctly subtracts distance from current height
  • effective_certificates_min_height() saturates at zero when distance exceeds current height
  • effective_certificates_min_height() returns zero when pruning is disabled

Testing

cargo test -p arc-consensus-types

All 31 tests pass.

@lau90eth lau90eth force-pushed the lau90eth/test-pruning-config branch from f48699a to efa1b1f Compare May 12, 2026 11:19
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.

1 participant