Skip to content

feat: add config snapshot, pending redemption list, queue event position, and SDK examples#387

Merged
Jayy4rl merged 3 commits into
StellarYield:mainfrom
DeborahOlaboye:feat/view-helpers-and-sdk-examples
Apr 30, 2026
Merged

feat: add config snapshot, pending redemption list, queue event position, and SDK examples#387
Jayy4rl merged 3 commits into
StellarYield:mainfrom
DeborahOlaboye:feat/view-helpers-and-sdk-examples

Conversation

@DeborahOlaboye
Copy link
Copy Markdown
Contributor

@DeborahOlaboye DeborahOlaboye commented Apr 26, 2026

Summary

  • Issue 265 — get_config_snapshot(): Added ConfigSnapshot struct (types.rs) holding early_redemption_fee_bps, min_deposit, max_deposit_per_user, zkme_verifier, and cooperator. Exposed as a new get_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): Added PendingRedemptionEntry struct (types.rs) and the paginated list_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_requested in events.rs to include a queue_position: u32 field 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.md covering 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 RedemptionPreflight struct in types.rs; missing closing braces for the for loop and return statement in can_redeem_many in lib.rs; Error::InvalidInput variant referenced but not declared (replaced with Error::InvalidInitParams).

Test plan

  • cargo test -p single_rwa_vault — 316 tests pass, 0 failures
  • New functions are purely additive view/read helpers; no existing behaviour is mutated
  • emit_early_redemption_requested signature change is backwards-compatible on the event consumer side (data tuple extended, not replaced)
  • Reviewer: simulate get_config_snapshot() and list_pending_redemptions() against a testnet deployment
  • Reviewer: confirm queue position appears in redemption request events on testnet

Closes #265
Closes #282
Closes #283
Closes #306

…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
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Apr 26, 2026

@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! 🚀

Learn more about application limits

… 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
@Jayy4rl Jayy4rl merged commit e471cab into StellarYield:main Apr 30, 2026
1 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants