Skip to content

test: third-party/compliance integration coverage + monitoring/database unit tests - #1055

Merged
nanaf6203-bit merged 2 commits into
MettaChain:mainfrom
hikmat67-code:feature/tests-third-party-compliance-monitoring-database
Aug 25, 2026
Merged

test: third-party/compliance integration coverage + monitoring/database unit tests#1055
nanaf6203-bit merged 2 commits into
MettaChain:mainfrom
hikmat67-code:feature/tests-third-party-compliance-monitoring-database

Conversation

@hikmat67-code

Copy link
Copy Markdown
Contributor

Summary

Adds the missing integration coverage for third-party (#1013) and compliance_registry (#1014) in tests/, plus previously untested unit surfaces for monitoring (#1015) and database export requests (#1016).

What's covered

Issue Location Coverage
#1013 tests/integration_third_party.rs full KYC lifecycle from service registration to verification, suspended services blocking KYC until reactivation, unregistered/wrong-type/non-provider rejections, fiat payment round-trip, invalid fee-percentage rejection
#1014 tests/integration_compliance.rs verifier flow unlocking compliance until revocation (require_compliance Ok → Err), partial screening not unlocking, non-verifier rejection, stored-data assertions
#1015 contracts/monitoring/src/lib.rs tests subscriber add/remove/list incl. duplicates + admin gate; snapshot take/retrieve with expected aggregates, distinct slots/ids, circular-buffer wraparound overwriting oldest slot
#1016 contracts/database/src/tests.rs admin-only export requests, all inverted-range combinations rejected (ids / blocks / both), equal boundaries accepted, exact field storage w/ sequential batch ids, completion flag + checksum, unknown-batch errors

Supporting changes

  • Revives the dead contracts/database/src/tests.rs by replacing the stale "extracted to tests.rs" comment with include!("tests.rs"); inside the contract module.
  • Visibility-only pub on compliance_registry and propchain_third_party contract modules (ink! v5 cross-crate import requirement).

No business logic changed.

Testing

  • cargo test -p propchain-monitoring → 26 passed (8 new)
  • cargo test -p propchain-database → 15 passed (9 new)
  • cargo test -p propchain-tests → 31 passed (11 new)

Closes #1013
Closes #1014
Closes #1015
Closes #1016

…database unit tests

- Third-party registry (MettaChain#1013): new tests/integration_third_party.rs —
  full KYC lifecycle from service registration to verification,
  unregistered/wrong-type service rejection, suspended services blocking
  KYC until reactivated, non-provider status updates rejected, state
  queries for unknown ids, fiat payment initiation/completion round-trip
  and invalid fee-percentage rejection at registration.
- Compliance registry (MettaChain#1014): new tests/integration_compliance.rs —
  verifier flow unlocking compliance until revocation (require_compliance
  Ok -> Err), partial screening not unlocking compliance, non-verifier
  submissions rejected, get_compliance_data field assertions.
- Monitoring (MettaChain#1015): unit tests for the previously uncovered subscriber
  and snapshot surfaces: subscribe/unsubscribe/get_alert_subscribers incl.
  duplicate and admin-gate behavior, snapshot take/retrieve round-trip
  with expected aggregates, distinct slots/ids for consecutive snapshots,
  circular-buffer wraparound overwriting the oldest slot, and reads beyond
  the written count returning None.
- Database (MettaChain#1016): revives the dead src/tests.rs (include! wiring inside
  the contract module, replacing the stale "extracted to tests.rs"
  comment) and adds export-request lifecycle coverage: admin-only
  requests, all invalid-range combinations rejected (inverted id range,
  inverted block range, both), equal boundaries accepted, valid requests
  storing exact fields with sequential batch ids, completion setting the
  flag + checksum, unknown-batch errors.

Both third-party and compliance_registry contract modules needed a
visibility-only `pub` fix to be importable cross-crate. No business logic
changed.

All green: monitoring 26, database 15, propchain-tests 31 passed.

Closes MettaChain#1013
Closes MettaChain#1014
Closes MettaChain#1015
Closes MettaChain#1016
@drips-wave

drips-wave Bot commented Aug 25, 2026

Copy link
Copy Markdown

@hikmat67-code 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

@nanaf6203-bit
nanaf6203-bit merged commit 93b7ef3 into MettaChain:main Aug 25, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants