Add an OperationalLimits getter#1664
Open
emteebug12-jpg wants to merge 1 commit into
Open
Conversation
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
|
@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! 🚀 |
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
Adds
get_operational_limits(), a single read returningmax_batch/max_limit/max_feein 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):OperationalLimitsstruct (max_batch,max_limit,max_fee) andget_operational_limits(), composing existing constants:max_batch←defaults::max_overdue_scan_batch_limit()max_limit←MAX_QUERY_LIMITmax_fee←init::MAX_FEE_BPS(nowpub(crate), previously private with no getter)quicklendx-contracts/src/lib.rs: wires the new module, registers the test module, and exposesget_operational_limits(env: Env) -> OperationalLimitsas 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 checkonmaincurrently fails with 13 pre-existing errors unrelated to this change (duplicatecompute_investor_tier, a circularMAX_QUERY_LIMITconst, a missingOptionalDisputeResolutiontype, 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 runcargo test,cargo clippy, or thewasm32release 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
mainbuilds again:cargo test -p quicklendx-contracts test_operational_limitscargo clippy --workspace --all-targets -- -D warningscargo build --target wasm32-unknown-unknown --releasecargo checkproduces the same error set with and without this branch's changes (no regressions introduced)