Skip to content

Add blacklist idempotency and precedence tests for blacklist_add/blacklist_remove and report_revenue snapshot #371

@thlpkee20-wq

Description

@thlpkee20-wq

Description

blacklist_add and blacklist_remove are documented as idempotent and issuer-only, and the blacklist is snapshotted into report_revenue events. Tests should confirm double-add does not duplicate, double-remove is a no-op, and that the blacklist vector embedded in rev_init/rev_ovrd events reflects the current set. Add this coverage including blacklist-over-whitelist precedence.

Requirements and context

  • Must be secure, tested, and documented
  • Should be efficient and easy to review
  • Relevant code: src/lib.rs (blacklist_add, blacklist_remove, is_blacklisted, get_blacklist, report_revenue)
  • Confirm a non-issuer caller cannot mutate the blacklist

Suggested execution

  • Fork the repo and create a branch
  • git checkout -b feat/blacklist-idempotency-tests
  • Implement changes
    • Add same investor twice, assert get_blacklist length unchanged
    • Remove a non-present investor, assert no panic and no event drift
    • Report revenue and assert event blacklist payload matches current set
  • Validate security and correctness assumptions

Test and commit

  • Run tests
    • cargo test
  • Cover edge cases
    • Empty blacklist snapshot, blacklist after transfer, blacklist+whitelist same address
  • Include test output and security notes

Example commit message

test: cover blacklist idempotency and event snapshot fidelity

Guidelines

  • Minimum 95 percent test coverage
  • Clear documentation
  • Timeframe: 96 hours

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions