test: third-party/compliance integration coverage + monitoring/database unit tests - #1055
Merged
nanaf6203-bit merged 2 commits intoAug 25, 2026
Conversation
…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
|
@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! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
tests/integration_third_party.rstests/integration_compliance.rsrequire_complianceOk → Err), partial screening not unlocking, non-verifier rejection, stored-data assertionscontracts/monitoring/src/lib.rstestscontracts/database/src/tests.rsSupporting changes
contracts/database/src/tests.rsby replacing the stale "extracted to tests.rs" comment withinclude!("tests.rs");inside the contract module.puboncompliance_registryandpropchain_third_partycontract 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