Skip to content

Implement appeal_link in the Soroban registry contract #5

Description

@Ryjen1

Problem

PaybeamEscrow::appeal_link is currently stubbed to return Error::NotImplemented (see contracts/stellink-escrow/src/lib.rs). The on-chain registry has no way to mark a link as appealed, even though the frontend already exposes the appeal action.

Proposal

Implement appeal_link so that either the link's creator OR a recipient address committed to the link record can mark a registered link as Appealed. Subsequent get_link calls return the appealed flag so off-chain UIs can suspend further state transitions.

Acceptance criteria

  • Add an appealed: bool field to LinkRecord. Default false on register_link.
  • Add an optional recipient: Option<Address> field to LinkRecord (set at registration time, used as one of the authorised appellants).
  • register_link accepts the recipient address as a new parameter.
  • appeal_link(env, link_id, caller):
    • Requires caller.require_auth().
    • Returns Error::LinkNotFound if the link doesn't exist.
    • Returns Error::Unauthorised unless caller == record.creator || Some(caller) == record.recipient.
    • Sets record.appealed = true and writes back to storage.
    • Emits an APPEAL event with (caller, link_id).
  • Calling appeal_link on an already-appealed link is a no-op (idempotent), not an error.
  • Add cargo tests covering: happy path (creator), happy path (recipient), unauthorised caller, unknown link, idempotency.

Files involved

  • contracts/stellink-escrow/src/lib.rs
  • contracts/stellink-escrow/src/test.rs

Notes

resolve_appeal is a separate issue (#6) — this issue only flips the flag. Resolution is the arbiter's job.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions