Repository navigation
chore: centralize and document timelock delay bounds in types module - #1400
Open
ayomhide2-web wants to merge 1 commit into
Open
ayomhide2-web wants to merge 1 commit into
ayomhide2-web wants to merge 1 commit into
Conversation
Move the admin timelock delay constants next to the DataKey that stores them and re-export them from admin.rs so existing imports keep working. Add a test covering the inclusive MIN..=MAX boundary and the values just outside it, which must return InvalidTimelockDelay. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
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
Centralizes timelock delay constants in
types.rsand updates validation to enforce configurable minimum and maximum delay limits.Changes Made
MIN_TIMELOCK_DELAYset to 3,600 seconds (1 hour).MAX_TIMELOCK_DELAYset to 604,800 seconds (7 days).DEFAULT_TIMELOCK_DELAYset to 86,400 seconds (24 hours).admin.rs::set_timelock_delayto validate delays against the centralized limits.ContractError::InvalidTimelockDelay.Testing
cargo test --lib test_adminmake clippyScope
No changes to the existing timelock security mechanism beyond centralizing constants and enforcing consistent validation limits.
Closes #1248