Skip to content

test: add test_accrual_none_checkpoint_returns_zero for accrual.rs No…#541

Open
oluwaseyi1996-netizen wants to merge 1 commit into
Fluxora-Org:mainfrom
oluwaseyi1996-netizen:test/accrual-none-branch-coverage
Open

test: add test_accrual_none_checkpoint_returns_zero for accrual.rs No…#541
oluwaseyi1996-netizen wants to merge 1 commit into
Fluxora-Org:mainfrom
oluwaseyi1996-netizen:test/accrual-none-branch-coverage

Conversation

@oluwaseyi1996-netizen
Copy link
Copy Markdown

@oluwaseyi1996-netizen oluwaseyi1996-netizen commented May 26, 2026

…ne-branch (#523)

Adds two integration tests to integration_suite.rs:

  • test_accrual_none_checkpoint_returns_zero: queries calculate_accrued at exactly start_time on a brand-new stream, exercising the None-branch of CheckpointState lookup (accrual.rs line 31) and asserting 0 is returned.
  • test_accrual_none_checkpoint_before_cliff_returns_zero: same scenario with cliff_time > start_time, confirming the cliff guard fires before any checkpoint arithmetic.

Closes #523
Closes #529
Closes #540

Pull Request

Description

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Test coverage improvement
  • Refactoring (no functional changes)

Related Issues

Closes #

Changes Made

Snapshot Test Changes

Did this PR modify snapshot test files?

  • Yes - snapshot files were updated (explain below)
  • No - no snapshot changes

If yes, explain why snapshots changed:

Behavior Changes:

Affected Snapshots:

  • test_snapshots/test/test_*.json

Verification:

  • Reviewed every changed .json file
  • Verified storage changes match intended behavior
  • Verified event payloads are correct
  • Verified authorization requirements are correct
  • Updated relevant documentation

Snapshot Update Command Used:

SOROBAN_SNAPSHOT_UPDATE=1 cargo test -p fluxora_stream

Testing

Test Coverage

  • All tests pass locally: cargo test -p fluxora_stream
  • New tests added for new functionality
  • Existing tests updated for changed functionality
  • Test coverage remains above 95%

Manual Testing

  • Tested on local environment
  • Tested edge cases
  • Tested error conditions

Documentation

  • Code comments added/updated
  • Documentation updated (if behavior changed)
  • README updated (if needed)
  • Snapshot test documentation reviewed

Security Considerations

  • No new security concerns introduced
  • Authorization boundaries verified
  • Input validation added/verified
  • Error handling reviewed

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

Additional Notes

Reviewer Checklist

  • Code quality and style
  • Test coverage adequate
  • Documentation complete
  • Snapshot changes justified and correct
  • Security implications reviewed
  • Breaking changes documented

…ne-branch (Fluxora-Org#523)

Adds two integration tests to integration_suite.rs:
- test_accrual_none_checkpoint_returns_zero: queries calculate_accrued at
  exactly start_time on a brand-new stream, exercising the None-branch of
  CheckpointState lookup (accrual.rs line 31) and asserting 0 is returned.
- test_accrual_none_checkpoint_before_cliff_returns_zero: same scenario with
  cliff_time > start_time, confirming the cliff guard fires before any
  checkpoint arithmetic.

Closes Fluxora-Org#523
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 26, 2026

@oluwaseyi1996-netizen Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

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

Labels

None yet

Projects

None yet

1 participant