Skip to content

Test coverage - #542

Open
CollinsC1O wants to merge 3 commits into
Core-Foundry:mainfrom
CollinsC1O:test-coverage
Open

Test coverage#542
CollinsC1O wants to merge 3 commits into
Core-Foundry:mainfrom
CollinsC1O:test-coverage

Conversation

@CollinsC1O

Copy link
Copy Markdown
Contributor

Summary

  • Fix crate-breaking merge corruption (mismatched braces, duplicate function/enum names, interleaved event structs) that had left hello-world unable to compile at all — none of the existing tests had ever actually run.
  • Add tests/reputation_test.rs (12 new tests): full contract-level coverage of sender reputation tracking (record_sender_delivery_success/failure, get_sender_reputation*), which previously had zero test coverage.
  • Wire the orphaned tests/batch_event_test.rs into the build — it existed on disk but was never included in lib.rs's test module tree.
  • Fix two real bugs surfaced by getting the suite running: a reputation-score formula that could never exceed 75 (Gold/Platinum tiers were unreachable), and an off-by-one in a test helper reading the wrong event topic (category vs. priority).
  • De-flake a gas-benchmark test in batch_ack_test.rs that relied on non-monotonic CPU-instruction metering; replaced with a deterministic invocation-count + functional-equivalence assertion.

Test plan

  • cargo test -p hello-world — 315/315 passing (0 before, since the crate didn't compile)
  • cargo build -p hello-world — clean build

Closes #403

@drips-wave

drips-wave Bot commented Jul 27, 2026

Copy link
Copy Markdown

@CollinsC1O 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

Development

Successfully merging this pull request may close these issues.

Increase Smart Contract Test Coverage

1 participant