Skip to content

Feat/get escrow state query - #41

Merged
Tybravo merged 2 commits into
SwiftChainn:mainfrom
BigJohn-dev:feat/get-escrow-state-query
Apr 25, 2026
Merged

Feat/get escrow state query#41
Tybravo merged 2 commits into
SwiftChainn:mainfrom
BigJohn-dev:feat/get-escrow-state-query

Conversation

@BigJohn-dev

Copy link
Copy Markdown
Contributor

Closes #13

Description

This PR implements the get_escrow public read-only query function for the Escrow Contract, enabling both frontend and backend layers of the SwiftChain logistics platform to inspect the current state and structure of any escrow record robustly.

Summary of Work Done

  • Safely replaced the ambiguous internal get_escrow_record function with the standardized public get_escrow(env: Env, delivery_id: u64) API.
  • Introduced the DeliveryNotFound enum natively into EscrowError.
  • Implemented state checking upon query execution: the contract now evaluates env.storage().persistent().has(..) accurately before fetching—if the delivery ID does not exist, the mechanism immediately bubbles up an EscrowError::DeliveryNotFound target panic.
  • Added Escrow structure dependencies natively to DataKey matching the target lookup specifications.
  • Extensively reorganized the escrow_contract/test.rs integration suite to safely utilize the new structured query function everywhere over legacy methods.
  • Executed strict edge-case verification via the new test_get_escrow_not_found unit test confirming missing query states evaluate dynamically toward the intended exception behaviors.

Cross-Contract Dependencies Introduced

No new cross-contract bounds were introduced. Operation purely expands persistent storage viewing capacities transparently for the SwiftChain Platform layers.

Test

All unit tests executed transparently across the Soroban SDK. No state mutations occur during reads.

@drips-wave

drips-wave Bot commented Apr 25, 2026

Copy link
Copy Markdown

@BigJohn-dev 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 3776bab into SwiftChainn:main Apr 25, 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 Get Escrow State Query Function

2 participants