feat: add config snapshot, pending redemption list, queue event position, and SDK examples#387
Merged
Jayy4rl merged 3 commits intoApr 30, 2026
Conversation
…ent, and SDK examples - Issue 265: add ConfigSnapshot struct and get_config_snapshot() for consolidated one-call read of fee_bps, min/max deposit, verifier, and cooperator fields - Issue 282: add PendingRedemptionEntry struct and list_pending_redemptions(offset, limit) with max page size of 20 for paginated operator review of the redemption queue - Issue 283: extend emit_early_redemption_requested with queue_position hint; compute approximate 1-based position by scanning pending requests before insertion - Issue 306: add SDK examples for redeem at maturity, early redemption request, paginated vault listing, and status/config checks to sdk/README.md - Fix two pre-existing upstream bugs: missing closing brace in can_redeem_many and missing closing brace for RedemptionPreflight struct in types.rs
|
@DeborahOlaboye 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! 🚀 |
… test bugs - Run cargo fmt to fix line-length formatting in lib.rs and test_events.rs - Remove unused EarlyRedemptionUserEventKind::Requested variant (now dead after emit_early_redemption_requested was rewritten to include queue position) - Fix deprecated soroban_sdk::Env::budget() calls in bench.rs → cost_estimate().budget() - Fix empty-line-after-doc-comment lint in test_lifecycle.rs - Fix vault_factory tests that destructured setup_factory into (client, _) where client was an Address, not a VaultFactoryClient; add proper VaultFactoryClient::new() calls for test_get_vaults_paginated_exact_triple_page_size, test_get_active_vaults_paginated_exact_double_page_size, test_default_vault_params_stored_and_readable, test_default_vault_params_overwrite_previous, and test_set_defaults_non_admin_rejected - Add #[allow(dead_code)] and explicit lifetime '_ to unused TestContext helpers and create_default_vault in vault_factory tests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Issue 265 —
get_config_snapshot(): AddedConfigSnapshotstruct (types.rs) holdingearly_redemption_fee_bps,min_deposit,max_deposit_per_user,zkme_verifier, andcooperator. Exposed as a newget_config_snapshot()view function so integrators can batch-read all frequently-queried config fields in one RPC call and cache until relevant admin events are observed.Issue 282 —
list_pending_redemptions(offset, limit): AddedPendingRedemptionEntrystruct (types.rs) and the paginatedlist_pending_redemptions(offset, limit)function (lib.rs). Results are ordered by ascending request ID, processed entries are excluded, and page size is capped at 20 to bound iteration cost. Operators and support tooling can page through the queue without scanning every request individually.Issue 283 — Redemption request event with queue position hint: Extended
emit_early_redemption_requestedinevents.rsto include aqueue_position: u32field in the event data. The position is computed before insertion as the count of currently-pending requests plus one. Documented as a best-effort hint — integrators should treat it as a UI signal only.Issue 306 — SDK examples: Added three new examples to
sdk/README.mdcovering redeem at maturity / early redemption request (Example 5), paginated vault listing via the factory (Example 6), and status + config snapshot checks (Example 7). All snippets map to current method signatures.Pre-existing upstream bug fixes (blocking compilation): missing closing brace for
RedemptionPreflightstruct intypes.rs; missing closing braces for theforloop and return statement incan_redeem_manyinlib.rs;Error::InvalidInputvariant referenced but not declared (replaced withError::InvalidInitParams).Test plan
cargo test -p single_rwa_vault— 316 tests pass, 0 failuresemit_early_redemption_requestedsignature change is backwards-compatible on the event consumer side (data tuple extended, not replaced)get_config_snapshot()andlist_pending_redemptions()against a testnet deploymentCloses #265
Closes #282
Closes #283
Closes #306