Skip to content

chore(blend-adapter): replace expect() with typed ContractError in accrue - #475

Merged
collinsezedike merged 1 commit into
drydocs:mainfrom
Adecom16:chore/replace-expect-with-contract-error
Aug 6, 2026
Merged

chore(blend-adapter): replace expect() with typed ContractError in accrue#475
collinsezedike merged 1 commit into
drydocs:mainfrom
Adecom16:chore/replace-expect-with-contract-error

Conversation

@Adecom16

@Adecom16 Adecom16 commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Closes #459

Summary

  • Replace expect() calls in accrue() with typed ContractError propagation.
  • Update accrue() to return Result<(), ContractError>.
  • Preserve existing contract behavior while aligning with the project's error-handling conventions.
  • Update affected tests and call sites where necessary.

Test plan

  • cargo fmt --all -- --check
  • cargo clippy --all-targets -- -D warnings
  • cargo test

@vercel

vercel Bot commented Aug 5, 2026

Copy link
Copy Markdown

@Adecom16 is attempting to deploy a commit to the Collins' projects Team on Vercel.

A member of the Team first needs to authorize it.

@collinsezedike collinsezedike left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The code is correct and matches #459's plan: both .expect() calls are replaced with ContractError::Overflow, accrue() now returns Result<(), ContractError>, existing tests updated to try_accrue(), and a new test exercises the overflow path directly rather than just changing the signature without covering it.

CI is failing on Commit Messages: the header "chore(blend-adapter): replace expect() with typed ContractError in accrue" is 73 characters, over the 72-character limit. Shorten it and push.

@Adecom16
Adecom16 force-pushed the chore/replace-expect-with-contract-error branch from 5ba42fc to fb4ce6c Compare August 6, 2026 12:34
@Adecom16

Adecom16 commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

Hi @collinsezedike, I've updated the commit message to meet the 72-character limit and pushed the changes. The requested change has been addressed. Thanks!

The code is correct and matches #459's plan: both .expect() calls are replaced with ContractError::Overflow, accrue() now returns Result<(), ContractError>, existing tests updated to try_accrue(), and a new test exercises the overflow path directly rather than just changing the signature without covering it.

CI is failing on Commit Messages: the header "chore(blend-adapter): replace expect() with typed ContractError in accrue" is 73 characters, over the 72-character limit. Shorten it and push.

@collinsezedike collinsezedike left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Header's fixed and CI is green. The fix itself was already verified: correctly collapses both .expect() calls into ContractError::Overflow, accrue() returns Result<(), ContractError>, tests updated to try_accrue(), and the new accrue_returns_typed_error_on_overflow test exercises the overflow path directly.

Thank you for sticking with this through the review back-and-forth.

Merging now.

@collinsezedike
collinsezedike merged commit 26be0a9 into drydocs:main Aug 6, 2026
8 of 9 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.

[Chore] Replace .expect() with typed ContractError in blend-adapter accrue()

2 participants