Skip to content

Comments

feat(#24): implement create_mission logic#29

Merged
Kaylahray merged 4 commits intoQuid-proquo:mainfrom
rocknwa:feat/create-mission-logic
Jan 30, 2026
Merged

feat(#24): implement create_mission logic#29
Kaylahray merged 4 commits intoQuid-proquo:mainfrom
rocknwa:feat/create-mission-logic

Conversation

@rocknwa
Copy link
Contributor

@rocknwa rocknwa commented Jan 29, 2026

This PR implements the create_mission function for the QuidStoreContract, fulfilling the requirements of Issue closes #24

Changes included:

  • Added create_mission function to initialize a new mission on-chain.

  • Verifies the creator’s signature with owner.require_auth().

  • Generates a unique mission ID by reading and incrementing MissionCount in instance storage.

  • Creates a Mission struct and saves it to persistent storage with DataKey::Mission(id).

  • Returns the new mission ID upon successful creation.

  • Includes comprehensive tests covering:

    • Successful mission creation
    • Multiple missions creation
    • Empty title / negative reward validations
    • Unlimited participants
    • Zero reward
    • Owner authentication
    • Status initialization
    • Timestamp correctness

Linked Issue: #24

- Added create_mission function to initialize a new mission
- Validates owner auth, generates unique ID, and saves to persistent storage
- Returns the new mission ID
- Includes tests for mission creation, validation, and counting

Linked to Issue Quid-proquo#24
@Kaylahray
Copy link
Contributor

Hi champ @rocknwa. Please pull from main and merge, I added the workflow. run the linting and clippy command too. Thank youu

…ew contract utilities

- Implemented create_mission logic with auth, ID generation, and storage
- Refactored contract to use new types.rs and error.rs utilities
- Synced with updated workflow and ran fmt + clippy
- Token transfer intentionally excluded (Issue Quid-proquo#25)
@rocknwa
Copy link
Contributor Author

rocknwa commented Jan 30, 2026

Hi @Kaylahray , thank you.
I’ve pulled and merged the latest main, updated the contract to use the new types.rs and error.rs utilities, and ran cargo fmt and cargo clippy successfully.
Changes are pushed 🚀

@Kaylahray
Copy link
Contributor

Hi @Kaylahray , thank you.
I’ve pulled and merged the latest main, updated the contract to use the new types.rs and error.rs utilities, and ran cargo fmt and cargo clippy successfully.
Changes are pushed 🚀

Hi @rocknwa. Thank you. Kindly run this in quid-contract/ "cargo fmt --all -- --check" then to fix the error run "cargo fmt --all" . Then run "cargo clippy --all-targets --all-features -- -D warnings".

@rocknwa
Copy link
Contributor Author

rocknwa commented Jan 30, 2026

Hi, @Kaylahray. Done that and removed stray space before #![cfg(test)]. Commands run successfully.
Thanks!

@Kaylahray
Copy link
Contributor

Hi, @Kaylahray. Done that and removed stray space before #![cfg(test)]. Commands run successfully. Thanks!

Great Job 🥂😊

@Kaylahray Kaylahray merged commit 908867d into Quid-proquo:main Jan 30, 2026
2 checks passed
@rocknwa rocknwa deleted the feat/create-mission-logic branch January 30, 2026 17:45
@rocknwa
Copy link
Contributor Author

rocknwa commented Jan 30, 2026

Thanks!
@Kaylahray

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.

Implement create mission Logic

2 participants