Skip to content

feat: add configuration getters to RefundVault and ReceiptAnchor (#195) - #261

Open
aurorabini wants to merge 2 commits into
accensa:mainfrom
aurorabini:feat/add-config-getters
Open

feat: add configuration getters to RefundVault and ReceiptAnchor (#195)#261
aurorabini wants to merge 2 commits into
accensa:mainfrom
aurorabini:feat/add-config-getters

Conversation

@aurorabini

Copy link
Copy Markdown

Configuration Getters

Adds read-only getters for all stored configuration values that were previously
only accessible via raw ledger entry reads.

RefundVault

  • get_admin() → merchant address
  • get_token() → payment token address
  • get_refund_window() → refund window in ledgers
  • is_paused() → whether the vault is paused

ReceiptAnchor

  • get_admin() → merchant address
  • get_pruned_up_to() → pruned-up-to batch ID

All return NotInitialized (rather than trapping) when called on an
uninitialized contract, matching the pattern established in #153.

Closes #195

RefundVault: get_admin, get_token, get_refund_window, is_paused
ReceiptAnchor: get_admin, get_pruned_up_to

All return NotInitialized (rather than trapping) when called on an
uninitialized contract.

Closes accensa#195
@mergekeeper

mergekeeper Bot commented Aug 28, 2026

Copy link
Copy Markdown

Needs changes

The PR implements the requested configuration getters for both contracts and uses proper error handling, but it is missing the required tests and the persistent-storage audit specified by linked issue #153.

Reviewed commit: a71f5a2c7d21e6537dbe1ee68409710def292698.

@mergekeeper mergekeeper Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs changes

The PR implements the configuration getters requested in #195, but omits the changes for #153 (replacing unwrap() calls on instance storage reads across the contracts and adding a partial-state test or reporting the persistent storage audit).

  • contracts/refund-vault/src/lib.rs: Issue #153 requires replacing all instance storage read unwrap() calls with ok_or(Error::NotInitialized)? across the codebase, which has not been fully addressed in this PR alongside issue #195.

Reviewed commit: 5ee408f33219e278c2ef1dd90c5be492a48488ae.

@mergekeeper mergekeeper Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs changes

The PR implements the requested configuration getters for both contracts and uses proper error handling, but it is missing the required tests and the persistent-storage audit specified by linked issue #153.

  • contracts/refund-vault/src/lib.rs:760: Missing unit or integration tests verifying that getters read back each value correctly after initialize and setters, and return NotInitialized when uninitialized (Issue #153/#195 requirements).

Reviewed commit: a71f5a2c7d21e6537dbe1ee68409710def292698.

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.

Config values are unreadable on-chain: no getter exposes the token, window, admin or pause state

2 participants