Skip to content

test: expand endorsement registry coverage - #548

Merged
Naomi-Gift merged 2 commits into
HubDApp:mainfrom
playmaker410:test/endorsement-registry-coverage
Aug 20, 2026
Merged

test: expand endorsement registry coverage#548
Naomi-Gift merged 2 commits into
HubDApp:mainfrom
playmaker410:test/endorsement-registry-coverage

Conversation

@playmaker410

@playmaker410 playmaker410 commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Summary

Expand the endorsement registry test suite so every public endorsement operation and its key edge cases are covered.

Type of Change

  • Bug fix (non-breaking change fixing an issue)
  • New feature (non-breaking change adding functionality)
  • Breaking change (fix or feature causing existing functionality to change)
  • Refactoring / Documentation update

Changes Made

  • verify empty defaults for endorsement count and membership lookups
  • verify endorse and unendorse update both the stored count and user membership
  • verify exact AlreadyEndorsed, NotEndorsed, and ProjectNotFound errors
  • verify endorse and unendorse require user authorization and failed calls preserve state
  • verify failed duplicate operations leave endorsement state unchanged
  • verify multiple-user counts, partial removals, and user/project isolation
  • verify re-endorsement after removal
  • document the current self-endorsement policy with a project-owner endorsement test; the contract has no self-endorsement prohibition or related error

Acceptance Criteria

  • endorse_project is covered
  • unendorse_project is covered
  • get_endorsement_count is covered for empty and populated state
  • has_endorsed is covered for true and false results
  • duplicate endorsement and unendorsement errors are covered
  • self-endorsement behavior is explicitly covered
  • authenticated-user requirements are covered

Test Coverage

  • cargo test -p dongle-contract endorsements --lib (13 passed)
  • cargo test (528 passed)
  • cargo build -p dongle-contract --target wasm32-unknown-unknown --release
  • rustfmt --edition 2021 --check dongle-smartcontract/src/tests/endorsements.rs

Related Issues

Closes #494

@Naomi-Gift
Naomi-Gift merged commit 6366c20 into HubDApp:main Aug 20, 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.

test: no tests for endorsement registry

2 participants