Skip to content

Feat/get delivery record query - #46

Merged
Tybravo merged 2 commits into
SwiftChainn:mainfrom
Divine-mercyx:feat/get-delivery-record-query
Apr 28, 2026
Merged

Feat/get delivery record query#46
Tybravo merged 2 commits into
SwiftChainn:mainfrom
Divine-mercyx:feat/get-delivery-record-query

Conversation

@Divine-mercyx

Copy link
Copy Markdown
Contributor

closes #26

…racker

Closes SwiftChainn#28

- Defined DriverProfile struct in shared_types.
- Implemented get_driver_profile read-only query.
- Incremented deliveries_completed and reputation_score on successful confirm_delivery.
- Added logic to start new drivers with a score of 0.
- Stored profiles in persistent storage keyed by driver address.
- Created unit tests covering single and multiple delivery score accumulation.
…y function

Closes SwiftChainn#26

- Implemented get_delivery(env: Env, delivery_id: DeliveryId) -> DeliveryRecord query in DeliveryContract.
- Used env.storage().persistent().get() to retrieve the full DeliveryRecord.
- Returns DeliveryNotFound panic/error for non-existent delivery IDs.
- Method is read-only and does not mutate any state.
- Added unit tests test_get_delivery_success and test_get_delivery_not_found.
@drips-wave

drips-wave Bot commented Apr 27, 2026

Copy link
Copy Markdown

@Divine-mercyx Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Tybravo
Tybravo merged commit f85f712 into SwiftChainn:main Apr 28, 2026
1 check passed
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.

Smart Contract: Implement Get Delivery Record Query Function

2 participants