Skip to content

feat: support metadata input on package creation in AidEscrow contract#407

Merged
Cedarich merged 4 commits intoPulsefy:mainfrom
Oluwaseyi89:feature/Support-Metadata-Input-on-Package-Creation
Apr 29, 2026
Merged

feat: support metadata input on package creation in AidEscrow contract#407
Cedarich merged 4 commits intoPulsefy:mainfrom
Oluwaseyi89:feature/Support-Metadata-Input-on-Package-Creation

Conversation

@Oluwaseyi89
Copy link
Copy Markdown
Contributor

Support Metadata Input on Package Creation

Summary

Updates create_package and batch_create_packages to accept and store metadata instead of always using an empty map.

Changes

  • Modified create_package signature to accept metadata: Map
  • Extended Package struct to include metadata field
  • Updated batch_create_packages to support metadata per package
  • Refactored all contract tests to use new metadata argument
  • Added test succeeds_with_metadata.1.json validating metadata storage and retrieval
  • Updated contract documentation and comments

Files Modified

  • contracts/aid_escrow/src/lib.rs – Core contract logic
  • contracts/aid_escrow/tests/*.rs – All test files updated for new signature
  • contracts/aid_escrow/test_snapshots/**/*.json – Snapshot updates

Evidence

  • ✅ Packages created with metadata store values correctly
  • ✅ Metadata retrievable via package queries
  • ✅ All existing tests pass with new signature
  • ✅ New snapshot succeeds_with_metadata.1.json added

Testing

cd contracts/aid_escrow
cargo test
  • All tests passing.

Closes #80

- Update  and  to accept and store metadata
- Extend  struct to include metadata field
- Update contract documentation and comments for metadata support
- Refactor all contract tests and integration tests to use new metadata argument
- Add/modify tests to verify metadata storage and retrieval
- Fix all related syntax and type errors in test files
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Apr 28, 2026

@Oluwaseyi89 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

@Oluwaseyi89
Copy link
Copy Markdown
Contributor Author

@Cedarich please, approve workflow to run.

@Cedarich
Copy link
Copy Markdown
Contributor

Check clippy

@Oluwaseyi89
Copy link
Copy Markdown
Contributor Author

@Cedarich everything is okay locally why is clippy failing on github CI?

@Cedarich
Copy link
Copy Markdown
Contributor

Cedarich commented Apr 29, 2026

Hey @Oluwaseyi89! 👋

Thanks for putting in the work on this metadata feature! There's a small issue in the test that's causing the CI to fail though.

In the test_cancel_package() function (around line 1147), the call to create_package is missing the metadata argument. You've already got package_metadata defined on line 1144, so it just needs to be passed along to the function call.

Quick fix:

let package_id = client.create_package(
    &operator,
    &1,
    &recipient,
    &1000,
    &token,
    &86400,
    &package_metadata,  // ← Add this
);

Once you add that, the test should compile and run smoothly! Let me know if you hit any other issues. 🚀

@Oluwaseyi89
Copy link
Copy Markdown
Contributor Author

@Cedarich approve workflow, please.

@Cedarich Cedarich merged commit a7f3433 into Pulsefy:main Apr 29, 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

Development

Successfully merging this pull request may close these issues.

Support Metadata Input on Package Creation

2 participants