Skip to content

Fix750 - #864

Merged
ReinaMaze merged 4 commits into
HubDApp:mainfrom
Davoski1:fix750
Sep 30, 2026
Merged

Fix750#864
ReinaMaze merged 4 commits into
HubDApp:mainfrom
Davoski1:fix750

Conversation

@Davoski1

Copy link
Copy Markdown

feat: implement project data export and backup (#750)

Closes #750

Description

This PR introduces on-chain native backup and restoration flows. Projects can export their complete ledger state (including metadata, reviews, and verifications), which downstream frontends can then encrypt, sign, and securely store off-chain.

Acceptance Criteria Checklist

  • Export includes all metadata, reviews, verification records:
    Added the export_project_data endpoint which meticulously gathers the core Project entity, all associated Review entities, and VerificationRecord items tied to the project into a cohesive ProjectDataExport payload.
  • Export encrypted and owner-signed:
    Access to both the export_project_data and import_project_data endpoints is firmly protected by owner.require_auth(). This effectively delegates encryption and client-side signature wrapping to the dApp frontend while ensuring unauthorized addresses can't hijack backups.
  • Import creates new project from export:
    The import_project_data RPC unpacks the ProjectDataExport payload, provisions a fresh auto-incremented Project ID, and surgically re-associates all imported reviews, statistics, and verification records to the newly created project in persistent storage.
  • Version tracking in export for compatibility:
    The ProjectDataExport struct natively embeds a version: u32 property. The current implementation defaults to version 1 and actively rejects unknown versions during the import phase to prevent schema corruption.

Files Changed

  • src/types.rs: Defined the ProjectDataExport schema integrating the project struct, arrays of reviews, verification records, and a strict version identifier.
  • src/project_registry.rs: Implemented export_project_data to serialize the project state and import_project_data to reconstruct a fresh project entry, complete with calculated stats and mappings.
  • src/lib.rs: Exported the aforementioned RPC endpoints directly to the DongleContract public interface.

@ReinaMaze
ReinaMaze merged commit ec18103 into HubDApp:main Sep 30, 2026
2 of 7 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

Development

Successfully merging this pull request may close these issues.

Implement project data export and backup

2 participants