Skip to content

fix(streaming): wire up test_features module and fix its failing tests - #625

Merged
Austinaminu2 merged 1 commit into
FlowwStar:mainfrom
Markodiba6399:fix/test-features-module
Aug 25, 2026
Merged

Austinaminu2 merged 1 commit into
FlowwStar:mainfrom
Markodiba6399:fix/test-features-module

Conversation

@Markodiba6399

@Markodiba6399 Markodiba6399 commented Aug 25, 2026 •

Copy link
Copy Markdown

Summary

  • mod test_features; was already declared in lib.rs, but the crate failed to compile because cleanup_stream fell off the end of its body without returning Ok(()) despite its Result<(), StreamError> signature — so the file's 26 tests (minus 8 already removed for the partial_cancel cleanup) never actually ran.
  • Fixed the compile error, then fixed 5 real bugs surfaced in test_features.rs itself:
    • test_pause_blocks_create_stream / _withdraw / _cancel were missing #[should_panic] even though the contract correctly rejects these calls while paused (ContractPaused/Add frontend unit tests for stream-utils.ts #16).
    • test_only_admin_can_unpause called get_stream on a stream that was never created.
    • test_withdraw_event_includes_remaining_withdrawable asserted remaining > 0 immediately after withdrawing the full unlocked amount at the same timestamp, which is mathematically 0.
  • Also fixed 3 pre-existing #[should_panic(expected = "...")] string mismatches in test.rs and test_security.rs (unrelated to test_features, but block a green cargo test): panic messages are now typed Error(Contract, #N), not the old descriptive strings.
  • Ran cargo fmt on test_features.rs (never checked before since it wasn't compiling) and fixed 2 clippy lifetime-elision errors that only surface under -D warnings.

Test plan

  • cargo test — 148 passed, 0 failed
  • cargo clippy --all-targets -- -D warnings — clean
  • cargo fmt --all -- --check — clean
  • cargo build --target wasm32v1-none --release — succeeds
  • cargo audit — no vulnerabilities (2 pre-existing allowed warnings)
  • node scripts/soroban-security-check.mjs — no issues

closes #522

mod test_features; was declared but the crate failed to compile due to
cleanup_stream missing a trailing Ok(()), so the file's 26 tests never
ran. Fix the compile error, then fix five real bugs in the tests
themselves (missing #[should_panic], a get_stream call on a stream that
was never created, and an assertion that didn't account for elapsed
time). Also fix three pre-existing #[should_panic(expected = ...)]
string mismatches in test.rs and test_security.rs that predate this
change, and clean up clippy/fmt so the contract CI job is green again.
@Austinaminu2
Austinaminu2 merged commit 426ddaf into FlowwStar:main Aug 25, 2026
3 of 7 checks passed

This branch had an error being deployed

1 failed deployment
staging — 7bdcde6a Deployed Aug 25, 2026 by Markodiba6399 via deploy-staging #192
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.

Wire up test_features.rs — it currently never compiles or runs

3 participants