feat(#24): implement create_mission logic#29
Conversation
- 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
|
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)
|
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". |
…nctional changes.
|
Hi, @Kaylahray. Done that and removed stray space before #![cfg(test)]. Commands run successfully. |
Great Job 🥂😊 |
|
Thanks! |
This PR implements the
create_missionfunction for the QuidStoreContract, fulfilling the requirements of Issue closes #24Changes included:
Added
create_missionfunction 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
MissionCountin instance storage.Creates a
Missionstruct and saves it to persistent storage withDataKey::Mission(id).Returns the new mission ID upon successful creation.
Includes comprehensive tests covering:
Linked Issue: #24