You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Once a link is appealed (issue #5), the contract needs an entry point for the configured arbiter to make a binding decision. Today resolve_appeal returns Error::NotImplemented.
Proposal
Implement resolve_appeal so the arbiter set at init time can resolve an appealed link by emitting a binding decision event that off-chain UIs and indexers can subscribe to.
Reads the arbiter from storage. If unset, return Error::Unauthorised.
Calls arbiter.require_auth().
Returns Error::LinkNotFound if the link doesn't exist.
Returns a new Error::NotAppealed if the link's appealed flag is false.
Returns a new Error::AlreadyResolved if record.resolution is already set.
Validates decision is one of the three legal values; otherwise Error::InvalidDecision.
Writes record.resolution = Some(decision) and emits a RESOLVE event with (arbiter, link_id, decision).
Add cargo tests covering: happy path for each decision, unauthorised non-arbiter caller, unknown link, not-yet-appealed link, double resolution.
Files involved
contracts/stellink-escrow/src/lib.rs
contracts/stellink-escrow/src/test.rs
Notes
The contract does NOT itself release any claimable balance. The decision event is the source of truth; off-chain claims (or a future on-chain helper) consume it.
Problem
Once a link is appealed (issue #5), the contract needs an entry point for the configured arbiter to make a binding decision. Today
resolve_appealreturnsError::NotImplemented.Proposal
Implement
resolve_appealso the arbiter set atinittime can resolve an appealed link by emitting a binding decision event that off-chain UIs and indexers can subscribe to.Acceptance criteria
Decisionenum:ReleaseToRecipient = 1,RefundToCreator = 2,Cancel = 3.resolve_appeal(env, link_id, decision):Error::Unauthorised.arbiter.require_auth().Error::LinkNotFoundif the link doesn't exist.Error::NotAppealedif the link'sappealedflag isfalse.Error::AlreadyResolvedifrecord.resolutionis already set.decisionis one of the three legal values; otherwiseError::InvalidDecision.record.resolution = Some(decision)and emits aRESOLVEevent with(arbiter, link_id, decision).Files involved
contracts/stellink-escrow/src/lib.rscontracts/stellink-escrow/src/test.rsNotes
The contract does NOT itself release any claimable balance. The decision event is the source of truth; off-chain claims (or a future on-chain helper) consume it.
Depends on #5 being merged first.