Skip to content

Implement delivery creation with auto-incrementing IDs#39

Merged
Tybravo merged 1 commit into
SwiftChainn:mainfrom
rexx010:feat/create-delivery-order-auto-id
Apr 24, 2026
Merged

Implement delivery creation with auto-incrementing IDs#39
Tybravo merged 1 commit into
SwiftChainn:mainfrom
rexx010:feat/create-delivery-order-auto-id

Conversation

@rexx010

@rexx010 rexx010 commented Apr 24, 2026

Copy link
Copy Markdown
Contributor

Closes #20

Description

This PR implements the create_delivery function for the delivery smart contract, introducing deterministic ID generation and persistent storage of delivery records.

Changes

  • Storage Updates: Added DeliveryCounter to DataKey enum and expanded the DeliveryRecord struct to include delivery_id and created_at.
  • Delivery Creation Logic: Implemented create_delivery to:
    • Enforce sender authorization.
    • Auto-increment a persistent ID counter.
    • Store the new delivery record with a Pending status and extended TTL.
    • Emit the delivery_created event.
  • Testing: Added unit tests verifying successful creation, correct state initialization, and persistent, incrementing IDs across multiple calls.

@drips-wave

drips-wave Bot commented Apr 24, 2026

Copy link
Copy Markdown

@rexx010 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 7fb5260 into SwiftChainn:main Apr 24, 2026
1 check failed
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 Create Delivery Order with Auto ID Generation

2 participants