Skip to content

feat(router-timelock): add get_op_count, get_ops_by_state, and empty description validation#168

Merged
Maki-Zeninn merged 2 commits intoMaki-Zeninn:mainfrom
Markadrian6399:feat/timelock-get-op-count-and-get-ops-by-state
Mar 30, 2026
Merged

feat(router-timelock): add get_op_count, get_ops_by_state, and empty description validation#168
Maki-Zeninn merged 2 commits intoMaki-Zeninn:mainfrom
Markadrian6399:feat/timelock-get-op-count-and-get-ops-by-state

Conversation

@Markadrian6399
Copy link
Copy Markdown
Contributor

@Markadrian6399 Markadrian6399 commented Mar 30, 2026

Summary

Closes the gap where frontends had to iterate all ops client-side with no server-side filtering, and prevents ops from being queued without a description.

Changes

New functions

  • get_op_count — returns total ops ever queued (reads NextOpId)

Validation

  • queue now rejects empty descriptions with new InvalidDescription = 17 error variant

Bug fix

  • Fixed pre-existing type inference error in get_pending_ops (missing turbofish on .get())

Tests

6 new tests added, all 37 pass:

  • test_get_op_count_zero_initially
  • test_get_op_count_increments_on_queue
  • test_get_ops_by_state_pending_only
  • test_get_ops_by_state_all
  • test_queue_empty_description_fails
  • test_queue_nonempty_description_succeeds

closes #158

- Add InvalidDescription = 17 error variant
- Guard queue against empty description strings
- Add test_queue_empty_description_fails and test_queue_nonempty_description_succeeds
- All 37 tests pass
@drips-wave
Copy link
Copy Markdown

drips-wave bot commented Mar 30, 2026

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

@Maki-Zeninn Maki-Zeninn merged commit 7ea3998 into Maki-Zeninn: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.

add empty description validation to queue in router-timelock

3 participants