Skip to content

feat: add metadata field and accessor to commitment#540

Merged
1nonlypiece merged 3 commits into
Commitlabs-Org:masterfrom
DeePrincipal-dev-lang:feature/commitment-metadata-field
May 28, 2026
Merged

feat: add metadata field and accessor to commitment#540
1nonlypiece merged 3 commits into
Commitlabs-Org:masterfrom
DeePrincipal-dev-lang:feature/commitment-metadata-field

Conversation

@DeePrincipal-dev-lang
Copy link
Copy Markdown
Contributor

feat: add metadata field and accessor to commitment

Summary

Adds an optional Map<String, String> metadata field to the Commitment struct so
off-chain context (e.g. risk notes, tags) passed by createCommitmentOnChain
round-trips through the contract.

Changes

  • contracts/escrow/src/lib.rs

    • Imported Map from soroban_sdk
    • Added metadata: Map<String, String> field to Commitment struct
    • Added metadata parameter to create_commitment (accepted and stored as-is)
    • Added get_metadata(commitment_id) read accessor
  • contracts/escrow/src/test.rs

    • Updated all existing create_commitment call sites to pass an empty Map
    • Added map import and Map to test imports

Remaining (in-progress)

  • Metadata round-trip tests (get_metadata store/read, empty map, multi-key)
  • contracts/README.md documentation update

Testing

Existing tests compile and pass with the updated signature. New
metadata-specific tests are pending.
closes #484

@vercel
Copy link
Copy Markdown

vercel Bot commented May 28, 2026

@DeePrincipal-dev-lang is attempting to deploy a commit to the 1nonly's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 28, 2026

@DeePrincipal-dev-lang 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

@1nonlypiece 1nonlypiece merged commit 5e8574f into Commitlabs-Org:master May 28, 2026
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.

Contracts - Add commitment metadata field and metadata read accessor

2 participants