Skip to content

feat(core): add tests, benchmarks & fixes for S004/S005/S007/S008 - #1064

Merged
Gbangbolaoluwagbemiga merged 2 commits into
HyperSafeD:mainfrom
abayomiwav:fix/issues-499-500-502-503
Jun 28, 2026
Merged

Gbangbolaoluwagbemiga merged 2 commits into
HyperSafeD:mainfrom
abayomiwav:fix/issues-499-500-502-503

Conversation

@abayomiwav

@abayomiwav abayomiwav commented Jun 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Test plan

  • cargo test -p sanctifier-core --no-default-features — all 166 tests pass, 0 failures
  • New test files: tests/custom_rules_test.rs (15 tests), tests/events_analysis_test.rs (9 tests), tests/storage_collision_test.rs (9 tests)
  • New fixtures: tests/fixtures/events_clean_contract.rs, tests/fixtures/events_inconsistent_contract.rs, tests/fixtures/storage_collision_contract.rs
  • Updated benches/benchmark.rs with S004/S005/S008 benchmark groups

Closes #499
Closes #500
Closes #502
Closes #503

Closes HyperSafeD#499, HyperSafeD#500, HyperSafeD#502, HyperSafeD#503

S004 (ledger size): add performance benchmarks with budgets for small,
nested, many-structs, and vault contract payloads including strict-limit
variant using BatchSize::SmallInput.

S005 (storage key collision): add unit tests + fixture covering cross-
function collisions, cross-storage-type non-collisions, single key
non-collision, and threat model edge cases. Fix fixture parse failure
caused by outer doc comments before #![no_std] in syn::parse_str.

S007 (custom rules): add unit tests for validate_custom_rules (invalid
regex, empty pattern, empty name, Display impl) and analyze_custom_rules
(line numbers, multi-match, overlapping rules, severity propagation,
snippet trimming, graceful invalid-regex handling).

S008 (events analysis): add unit tests + fixtures for inconsistent topic
count detection and gas optimization hints. Fix multiline event publish
calls (env.events()\n.publish(...)) being missed by the line scanner by
adding a normalization pass that joins split lines before scanning.
@vercel

vercel Bot commented Jun 28, 2026

Copy link
Copy Markdown

@abayomiwav is attempting to deploy a commit to the gbangbolaoluwagbemiga's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Jun 28, 2026

Copy link
Copy Markdown

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

@Gbangbolaoluwagbemiga
Gbangbolaoluwagbemiga merged commit 5900e5d into HyperSafeD:main Jun 28, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment