Skip to content

feat(contract): add get_config getter for operational limits - #194

Closed
dezzy-music wants to merge 1 commit into
DepRadarOrg:mainfrom
dezzy-music:contract/173-get-config
Closed

dezzy-music wants to merge 1 commit into
DepRadarOrg:mainfrom
dezzy-music:contract/173-get-config

Conversation

@dezzy-music

Copy link
Copy Markdown

Description

Introduces a public get_config getter on DepRaderRouter that returns the contract's fixed operational limits (REVIEW_WINDOW_SECS, MAX_BOUNTY_DURATION_SECS, MAX_CLAIMS_PER_BOUNTY, MAX_REF_LEN) as a typed Config struct. This prevents frontends and clients from hardcoding constants and silently diverging upon contract updates.

Closes #173


Tasks Completed

  • Defined Config struct with review_window_secs, max_bounty_duration_secs, max_claims_per_bounty, and max_ref_len.
  • Implemented pub fn get_config(_env: Env) -> Config on DepRaderRouter.
  • Added unit test test_get_config_matches_constants verifying that get_config strictly matches the contract's defined constants.
  • Updated test snapshots (test_get_config_matches_constants.1.json).
  • Documented the change in PROGRESS.md.

Acceptance Criteria

  • A test asserts the getter matches the constants: test_get_config_matches_constants
  • cargo fmt, cargo clippy -- -D warnings and cargo test --workspace pass
  • Contract test snapshots are updated and the wasm build succeeds
  • PROGRESS.md entry added, and the PR description includes Closes #173

Stellar Address (Stellar Wave Program)

GDLCJGQLXZGDAAT5QGRF6FM2MBEER3FPYGCSVPXYL47G2ABIOX2M2S6K

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.

[contract] Add a get_config getter

2 participants