Skip to content

test: add adversarial coverage for list_offerings in lib - #1302

Closed
MuhammadDG wants to merge 12 commits into
RevoraOrg:masterfrom
MuhammadDG:fix/issue-1075-add-adversarial-coverage-for-list-offerings-in
Closed

MuhammadDG wants to merge 12 commits into
RevoraOrg:masterfrom
MuhammadDG:fix/issue-1075-add-adversarial-coverage-for-list-offerings-in

Conversation

@MuhammadDG

@MuhammadDG MuhammadDG commented Oct 17, 2026 •

Copy link
Copy Markdown

Overview

This PR adds focused adversarial test coverage for the list_offerings contract method in src/lib.rs. The new test module exercises valid calls, boundary and invalid inputs for env: Env, issuer: Address, and namespace: Symbol, verifies unauthorized-caller behavior where relevant, and asserts that state is unchanged after rejected operations.

Related Issue

Changes

🧪 Adversarial tests for list_offerings

  • [ADD] src/test_offering_count_adversarial.rs
    • Focused test module targeting list_offerings in src/lib.rs.
    • Covers the happy path (valid env, issuer, namespace) to confirm the public contract is preserved.
    • Exercises boundary and invalid inputs for issuer: Address and namespace: Symbol (e.g. unknown issuer, empty/unknown namespace).
    • Exercises unauthorized-caller paths where the contract enforces authorization.
    • Asserts that rejected operations leave stored state unchanged, and that error/boundary behavior is deterministic and observable.
    • No changes to the public contract of list_offerings; tests only.

Verification Results

cargo test test_offering_count_adversarial
✅ focused adversarial suite passed

cargo test
✅ surrounding suite passed

cargo clippy --all-targets -- -D warnings
✅ no warnings

cargo build
✅ build succeeded
Acceptance Criteria Status
Cover the named behavior with focused automated tests, including the relevant success and failure paths ✅ Valid, boundary, invalid, and unauthorized paths covered in src/test_offering_count_adversarial.rs
Preserve the existing public contract unless the change includes an explicit compatibility plan ✅ No contract changes; tests only
Make error and boundary behavior observable and deterministic ✅ Rejected operations assert deterministic errors and unchanged state

Closes #1075

@MuhammadDG MuhammadDG changed the title test: add adversarial coverage for list_offerings in lib test: add adversarial coverage for list_offerings in src/lib.rs Oct 18, 2026
@MuhammadDG MuhammadDG changed the title test: add adversarial coverage for list_offerings in src/lib.rs test: add adversarial coverage for list_offerings in lib Oct 18, 2026
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.

Add adversarial coverage for list_offerings in lib

3 participants