Skip to content

Rewrite of delete_records_batch and is_record_locked functions#263

Open
chrisgitiota wants to merge 2 commits into
chore/security-auditfrom
chore/security-audit-new-delete-records-batch
Open

Rewrite of delete_records_batch and is_record_locked functions#263
chrisgitiota wants to merge 2 commits into
chore/security-auditfrom
chore/security-audit-new-delete-records-batch

Conversation

@chrisgitiota
Copy link
Copy Markdown
Contributor

  • Rewrite of the delete_records_batch() and is_record_locked() functions.
  • window_count_based(0) is now forbidden in favor of using window_none() instead to prevent silently misconfigured trails.

window_count_based(0) is now forbidden in favor of using window_none() instead to prevent silently misconfigured trails.
@chrisgitiota chrisgitiota requested a review from itsyaasir May 20, 2026 07:32
/// protect no records and is functionally identical to `window_none()`;
/// rejecting it at construction prevents silently misconfigured trails.
public fun window_count_based(count: u64): LockingWindow {
assert!(count > 0, ECountWindowMustBePositive);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is nice, and I think it will be nice to add this to our libraries for early returns.

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.

2 participants