Skip to content

Comments

feat(contract): scaffold submit_feedback#54

Open
phertyameen wants to merge 1 commit intoQuid-proquo:mainfrom
phertyameen:feat/scaffold_submit_feedback
Open

feat(contract): scaffold submit_feedback#54
phertyameen wants to merge 1 commit intoQuid-proquo:mainfrom
phertyameen:feat/scaffold_submit_feedback

Conversation

@phertyameen
Copy link
Contributor

Closes #39
Implements the submit_feedback function allowing hunters
to submit an IPFS CID for a given mission.

Changes

  • Add submit_feedback(env, mission_id, hunter, ipfs_cid) to contract impl
  • Requires hunter.require_auth() before any state is written
  • Persists ipfs_cid under DataKey::Submission(mission_id, hunter) in persistent storage

Tests

  • Stores and retrieves CID correctly from persistent storage
  • Overwrites previous submission (last-write-wins documented)
  • Different hunters on the same mission have independent storage keys
  • Same hunter on different missions has independent storage keys
  • Fails without hunter auth (#[should_panic])
  • Asserts hunter is the exact authorising address via env.auths()

Testing

cargo test

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.

[Contract] Implement 'submit_feedback'

1 participant