Skip to content

refactor(forge-vesting): deprecate get_config() in favour of get_vest…#298

Merged
Austinaminu2 merged 1 commit intoAustinaminu2:mainfrom
zeekman:refactor/244-vesting-get-config-deprecation
Mar 30, 2026
Merged

refactor(forge-vesting): deprecate get_config() in favour of get_vest…#298
Austinaminu2 merged 1 commit intoAustinaminu2:mainfrom
zeekman:refactor/244-vesting-get-config-deprecation

Conversation

@zeekman
Copy link
Copy Markdown
Contributor

@zeekman zeekman commented Mar 30, 2026

What does this PR do?

get_config() returns the full VestingConfig including the admin address
and internal cancelled flag. Exposing the admin address publicly is a
privacy concern, and having three read functions with no guidance creates
confusion about which one integrators should use.

The contract already has cleaner alternatives — get_vesting_schedule() for
schedule parameters and get_status() for live claimable state. This PR
adds a deprecation notice to get_config() pointing to those, documents
the distinction in the README, and adds a test proving the two preferred
functions together cover all UI-facing data needs.

No behaviour changes. get_config() is retained for admin tooling and
backward compatibility.

Related issue

Testing done

Added test_schedule_and_status_provide_full_ui_info_without_get_config:
initializes a vesting schedule, advances past the cliff, and asserts that
get_vesting_schedule() + get_status() together expose token, beneficiary,
amounts, timing, cliff status, and claimable amount — without needing
get_config().

Checklist

  • I have run cargo fmt (or equivalent formatter)
  • I have run cargo clippy (or equivalent linter)
  • All tests pass locally
  • I have labeled this PR with 'good first issue' or 'dx' where applicable.

Closes #244

…ing_schedule() + get_status()

Fixes Austinaminu2#244. get_config() exposes the admin address and cancelled flag
publicly, which is a privacy concern and creates confusion about which
read function integrators should use.

Changes:
- Add deprecation notice to get_config() doc comment pointing to
  get_vesting_schedule() and get_status() as preferred alternatives;
  note it is retained for admin tooling and backward compatibility
- Add test_schedule_and_status_provide_full_ui_info_without_get_config
  verifying that get_vesting_schedule() + get_status() together cover
  all UI-facing data needs without requiring get_config()
- Document the three-function distinction in README
@drips-wave
Copy link
Copy Markdown

drips-wave bot commented Mar 30, 2026

@zeekman 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

@Austinaminu2 Austinaminu2 merged commit 0f1a793 into Austinaminu2:main Mar 30, 2026
1 check failed
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.

forge-vesting get_config() exposes admin address and cancelled flag — should use get_vesting_schedule() for public-facing reads

2 participants