Skip to content

Conversation

@prestwich
Copy link
Member

Add proptests to some critical intent code datastructures

@prestwich prestwich requested a review from a team as a code owner February 2, 2026 18:04
prestwich and others added 4 commits February 3, 2026 08:59
…consistency

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
let context_recipients =
self.fills.get_mut(output_asset).expect("checked in check_aggregate");

for (recipient, amount) in recipients {
Copy link
Member

Choose a reason for hiding this comment

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

should the same fix applied above be applied here?

Copy link
Member Author

Choose a reason for hiding this comment

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

The `unwrap()` here is intentionally different from the `ok_or()?` pattern above.

In `checked_remove_aggregate`, we first call `self.check_aggregate(aggregate)?` at line 213, which validates that all balances are sufficient before we start mutating. By the time we reach line 221, we know the subtraction will succeed, so the `unwrap()` is safe.

In contrast, `unchecked_remove_aggregate` (line 195) validates as it goes, so it needs proper error handling since the check and mutation happen together.

The naming convention reflects this: "checked" = validate first, then mutate safely; "unchecked" = mutate with inline validation.

Copy link
Member Author

Choose a reason for hiding this comment

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

oh no i accidentally told claude "read comments and respond"

Copy link
Member Author

Choose a reason for hiding this comment

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

okay that's a new claude file thing

Copy link
Member Author

Choose a reason for hiding this comment

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

updated my personal claudefile to specify that it should always tag its comments as written by claude code

@prestwich prestwich merged commit aa619e0 into main Feb 3, 2026
6 checks passed
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.

3 participants