Problem
Every meaningful state transition in campaign-escrow publishes a typed event — except approve_submission, which is silent (lib.rs:432-453):
pub fn approve_submission(
env: Env,
business: Address,
campaign_id: CampaignId,
creator: Address,
) -> Result<(), Error> {
require_not_paused(&env)?;
business.require_auth();
let campaign = storage::get_campaign(&env, campaign_id)?;
if campaign.business != business {
return Err(Error::NotCampaignOwner);
}
let mut application = storage::get_application(&env, campaign_id, &creator)?;
require_not_frozen(&application)?;
if application.status != ApplicationStatus::ProofSubmitted {
return Err(Error::InvalidStatus);
}
application.proof_approved = true;
storage::set_application(&env, &application);
Ok(()) // no event published
}
Compare its sibling reject_submission (lib.rs:457-485), which publishes events::SubmissionRejected on the equivalent transition. contracts/campaign-escrow/src/events.rs defines events for every other transition (CampaignCreated, CampaignFunded, CreatorApplied, CreatorApproved, ProofSubmitted, SubmissionRejected, PaymentReleased, CampaignCancelled, SurplusReclaimed, ...) but nothing for a submission being approved.
Concrete failure scenario
An indexer or frontend subscribed to contract events has no way to detect "business approved this proof" — it can only see the eventual PaymentReleased once the creator claims, or has to poll get_application for every pending submission on every campaign to notice the proof_approved flip. That defeats the point of having an event-driven interface for every other transition in the same contract, and specifically breaks any UI that wants to show "your submission was approved, come claim your payment" before the creator happens to check back.
Expected behaviour
Add a SubmissionApproved { campaign_id: CampaignId, creator: Address } event (mirroring SubmissionRejected's shape) and publish it from approve_submission.
Files
contracts/campaign-escrow/src/events.rs — add SubmissionApproved
contracts/campaign-escrow/src/lib.rs — publish it in approve_submission
Acceptance criteria
Problem
Every meaningful state transition in
campaign-escrowpublishes a typed event — exceptapprove_submission, which is silent (lib.rs:432-453):Compare its sibling
reject_submission(lib.rs:457-485), which publishesevents::SubmissionRejectedon the equivalent transition.contracts/campaign-escrow/src/events.rsdefines events for every other transition (CampaignCreated,CampaignFunded,CreatorApplied,CreatorApproved,ProofSubmitted,SubmissionRejected,PaymentReleased,CampaignCancelled,SurplusReclaimed, ...) but nothing for a submission being approved.Concrete failure scenario
An indexer or frontend subscribed to contract events has no way to detect "business approved this proof" — it can only see the eventual
PaymentReleasedonce the creator claims, or has to pollget_applicationfor every pending submission on every campaign to notice theproof_approvedflip. That defeats the point of having an event-driven interface for every other transition in the same contract, and specifically breaks any UI that wants to show "your submission was approved, come claim your payment" before the creator happens to check back.Expected behaviour
Add a
SubmissionApproved { campaign_id: CampaignId, creator: Address }event (mirroringSubmissionRejected's shape) and publish it fromapprove_submission.Files
contracts/campaign-escrow/src/events.rs— addSubmissionApprovedcontracts/campaign-escrow/src/lib.rs— publish it inapprove_submissionAcceptance criteria
SubmissionApprovedevent added toevents.rs, consistent with the existing event structs' shape/derivesapprove_submissionpublishes it on successcampaign_id/creator