Skip to content

Add an OperationalLimits getter#1664

Open
emteebug12-jpg wants to merge 1 commit into
QuickLendX:mainfrom
emteebug12-jpg:feature/operational-limits-getter
Open

Add an OperationalLimits getter#1664
emteebug12-jpg wants to merge 1 commit into
QuickLendX:mainfrom
emteebug12-jpg:feature/operational-limits-getter

Conversation

@emteebug12-jpg

Copy link
Copy Markdown

Summary

Adds get_operational_limits(), a single read returning max_batch / max_limit / max_fee in one call, instead of requiring a separate probe per value (and, for the fee ceiling, there was previously no getter at all).

Closes #1539

Changes

  • quicklendx-contracts/src/operational_limits.rs (new): OperationalLimits struct (max_batch, max_limit, max_fee) and get_operational_limits(), composing existing constants:
    • max_batchdefaults::max_overdue_scan_batch_limit()
    • max_limitMAX_QUERY_LIMIT
    • max_feeinit::MAX_FEE_BPS (now pub(crate), previously private with no getter)
  • quicklendx-contracts/src/lib.rs: wires the new module, registers the test module, and exposes get_operational_limits(env: Env) -> OperationalLimits as a public, auth-free contract read.
  • quicklendx-contracts/src/test_operational_limits.rs (new): contract-level tests verifying the getter matches the source constants, requires no auth, and is stable across calls.
  • docs/contracts/limits.md: documents the new getter and its three fields.

No existing constant values changed — this only adds a read-only aggregation on top of values that already existed (or, for max_fee, makes an existing private constant available for the first time).

Note on CI / build status

cargo check on main currently fails with 13 pre-existing errors unrelated to this change (duplicate compute_investor_tier, a circular MAX_QUERY_LIMIT const, a missing OptionalDisputeResolution type, etc.) — these appear to be leftovers from recent merges that were auto-resolved with -X theirs. I confirmed my diff introduces no new errors (same 13 errors before and after this branch), but I could not run cargo test, cargo clippy, or the wasm32 release build to a green state because of this pre-existing breakage. Happy to rebase once main is fixed, or to help fix it in a separate PR if useful.

Test plan

  • Once main builds again: cargo test -p quicklendx-contracts test_operational_limits
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo build --target wasm32-unknown-unknown --release
  • Manually verified cargo check produces the same error set with and without this branch's changes (no regressions introduced)

Adds get_operational_limits(), returning max_batch, max_limit, and
max_fee in one call instead of requiring separate probes per value
(the fee ceiling previously had no getter at all).

Closes QuickLendX#1539
@drips-wave

drips-wave Bot commented Jun 26, 2026

Copy link
Copy Markdown

@emteebug12-jpg 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

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.

Add an OperationalLimits getter

1 participant