Skip to content

Add settlement_status entrypoint for narrow settlement status reads - #248

Merged
Jagadeeshftw merged 1 commit into
AnchorNet-Org:mainfrom
Samaro1:settlement-status-112
Jul 27, 2026
Merged

Add settlement_status entrypoint for narrow settlement status reads#248
Jagadeeshftw merged 1 commit into
AnchorNet-Org:mainfrom
Samaro1:settlement-status-112

Conversation

@Samaro1

@Samaro1 Samaro1 commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Implements settlement_status(env, id) -> Result<SettlementStatus, Error> as described in issue #112.

Changes:

  • Added settlement_status entrypoint in src/lib.rs (near settlement/settlement_exists) that returns just the SettlementStatus field via storage::get_settlement, or Error::SettlementNotFound for a missing id — matching settlement's error behavior.
  • Added src/test.rs coverage: tests for each of the four SettlementStatus variants (Pending, Executed, Cancelled, Expired) and for a missing id (SettlementNotFound).
  • Updated the README settlement table to document the new settlement_status(id) view.

This narrows the client-facing return type and payload for keeper polling loops, reducing cross-contract call payload size and keeping settlement-state checks auditable in one place.

Implements settlement_status(env, id) -> Result<SettlementStatus, Error> as described in issue AnchorNet-Org#112.

- Added settlement_status entrypoint in src/lib.rs (near settlement/settlement_exists) that returns just the SettlementStatus field via storage::get_settlement, or Error::SettlementNotFound for a missing id.
- Added src/test.rs coverage: tests for Pending, Executed, Cancelled, Expired variants and for a missing id (SettlementNotFound).
- Updated the README settlement table to document the new settlement_status(id) view.

Relates to: AnchorNet-Org#112
@Samaro1
Samaro1 force-pushed the settlement-status-112 branch from 3008007 to b83addd Compare July 27, 2026 18:31
@Jagadeeshftw
Jagadeeshftw merged commit 78e0b27 into AnchorNet-Org:main Jul 27, 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.

2 participants