Skip to content

test: integration coverage for gdpr, factory, ipfs-metadata and fractional contracts - #1053

Merged
nanaf6203-bit merged 1 commit into
MettaChain:mainfrom
devbackend513-ux:feature/integration-tests-gdpr-factory-ipfs-fractional
Aug 25, 2026
Merged

test: integration coverage for gdpr, factory, ipfs-metadata and fractional contracts#1053
nanaf6203-bit merged 1 commit into
MettaChain:mainfrom
devbackend513-ux:feature/integration-tests-gdpr-factory-ipfs-fractional

Conversation

@devbackend513-ux

Copy link
Copy Markdown
Contributor

Summary

Adds integration test coverage in tests/ for four contract crates that previously had none: gdpr (#1005), factory (#1006), ipfs-metadata (#1007) and fractional (#1008). New modules are declared in tests/lib.rs, following the existing integration_bridge_oracle.rs pattern.

What's covered

Issue Crate Coverage
#1005 gdpr grant → check → withdraw lifecycle, subject/admin withdraw authorization, data-access request/fulfillment with admin gate, zero-duration rejection, per-purpose independence
#1006 factory code-hash registration round-trip, CodeHashNotSet rejection on unregistered deploy, deployment registry recording, change_admin lockout
#1007 ipfs-metadata validate_and_register_metadata incl. the documented AccessLevel::Admin escalation path, CID/metadata validation matrix, unauthorized attempts
#1008 fractional mint → list → buy settlement w/ balance updates, partial purchase, under/overspend rejections, cancel_listing guard

Supporting changes

  • tests/Cargo.toml: declare propchain-gdpr, propchain-factory, ipfs-metadata.
  • Visibility-only pub on the gdpr_consent/fractional/ipfs_metadata contract modules (ink! v5 requires a public module path for cross-crate imports).

No business logic changed.

Testing

  • cargo test -p propchain-tests42 passed (22 new)

Closes #1005
Closes #1006
Closes #1007
Closes #1008

…ractional

Adds integration test modules to the propchain-tests suite (declared in
tests/lib.rs) covering four contract crates that had zero integration
coverage:

- GDPR (MettaChain#1005): grant -> check -> withdraw consent lifecycle, subject vs
  admin withdraw authorization, data-access request/fulfillment with the
  admin gate enforced, zero-duration rejection (InvalidDuration),
  per-purpose consent independence, unknown-id lookups.
- Factory (MettaChain#1006): code-hash registration round-trip and non-admin
  rejection, deploy without a registered hash rejected via CodeHashNotSet,
  deployment registry recording (count/deployer list), change_admin
  lockout of the old admin.
- IPFS metadata (MettaChain#1007): validate_and_register_metadata storage
  assertions including the documented AccessLevel::Admin escalation path,
  CID validation matrix, metadata validation rejections, unauthorized
  document/verification attempts rejected.
- Fractional (MettaChain#1008): mint -> list -> buy full settlement with balance
  updates, partial purchase updating the listing, underpayment and
  oversized-purchase rejections, cancel_listing blocking purchases.

Also declares propchain-gdpr, propchain-factory and ipfs-metadata as
test-crate dependencies and makes the gdpr/fractional/ipfs-metadata
contract modules `pub` so they can be imported cross-crate (ink! v5
requires a public module path; factory already had it). No business
logic is changed.

All 42 tests in `cargo test -p propchain-tests` pass, including 22 new ones.

Closes MettaChain#1005
Closes MettaChain#1006
Closes MettaChain#1007
Closes MettaChain#1008
@drips-wave

drips-wave Bot commented Aug 25, 2026

Copy link
Copy Markdown

@devbackend513-ux 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 94cb95a into MettaChain:main Aug 25, 2026
1 of 2 checks 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