Skip to content

Add rust unit tests for identity, reputation, document contracts#1075

Open
Johnbliss60 wants to merge 1 commit into
CodeGirlsInc:mainfrom
Johnbliss60:contract-01-tests
Open

Add rust unit tests for identity, reputation, document contracts#1075
Johnbliss60 wants to merge 1 commit into
CodeGirlsInc:mainfrom
Johnbliss60:contract-01-tests

Conversation

@Johnbliss60

Copy link
Copy Markdown

Closes #1010

Adds comprehensive cargo test coverage for the three Soroban contracts in contracts/ that previously had zero tests, per the issue's acceptance criteria.

  • Identity (6 tests): registration, duplicate-wallet rejection, admin revoke, non-admin revoke rejection (via mock_auths), unregistered-wallet lookups
  • Reputation (15 tests): rating submission/aggregation, composite score formula, self-rating/duplicate-rating rejection, stats updates, authorization checks
  • Document (13 tests): registration, duplicate-hash rejection, integrity verification, admin verify/revoke flows, non-admin rejection

Note: the document contract was missing two pieces the issue's acceptance criteria required — a revoke_document function (with is_revoked field) and duplicate-hash rejection on registration. Both were added as minimal, additive changes alongside their tests.

All tests moved from inline lib.rs modules into dedicated src/test.rs files per the issue's requested convention. cargo test run in contracts/ — all 53 tests pass (34 new + 19 pre-existing in shipment/escrow, unaffected).

@vercel

vercel Bot commented Jun 28, 2026

Copy link
Copy Markdown

@Johnbliss60 is attempting to deploy a commit to the Mftee's projects Team on Vercel.

A member of the Team first needs to authorize it.

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.

[CONTRACT-01] Soroban Contract Test Suite: Identity, Reputation & Document Registry

1 participant