feat: add configuration getters to RefundVault and ReceiptAnchor (#195) - #261
feat: add configuration getters to RefundVault and ReceiptAnchor (#195)#261aurorabini wants to merge 2 commits into
Conversation
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
|
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: |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
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 addressget_token()→ payment token addressget_refund_window()→ refund window in ledgersis_paused()→ whether the vault is pausedReceiptAnchor
get_admin()→ merchant addressget_pruned_up_to()→ pruned-up-to batch IDAll return
NotInitialized(rather than trapping) when called on anuninitialized contract, matching the pattern established in #153.
Closes #195