Split FlowALPv0 further: extract health math and position resources#183
Open
Split FlowALPv0 further: extract health math and position resources#183
Conversation
…ional Add doc comments to all four public functions in FlowALPHealth following the positionSatisfiesMinimumBalance doc style. Change interest index parameters (withdrawCreditInterestIndex, depositDebitInterestIndex) to optional types, passing nil when the balance direction doesn't match instead of a dummy 1.0 value. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
jordanschalm
approved these changes
Feb 27, 2026
Member
There was a problem hiding this comment.
Looks good. Thanks for adding this.
I verified that changes were move-only using the following diff commands against this commit (asked Claude to get the appropriate lines to diff on each branch):
diff -u -w <(git show origin/main:cadence/contracts/FlowALPv0.cdc | sed -n '650,709p') <(git show origin/liob/split-v0-health-position-resources:cadence/contracts/FlowALPHealth.cdc |
sed -n '7,71p') | delta --side-by-side --file-style omit --line-fill-method ansi
diff -u -w <(git show origin/main:cadence/contracts/FlowALPv0.cdc | sed -n '713,832p') <(git show origin/liob/split-v0-health-position-resources:cadence/contracts/FlowALPHealth.cdc |
sed -n '75,190p') | delta --side-by-side --file-style omit --line-fill-method ansi
diff -u -w <(git show origin/main:cadence/contracts/FlowALPv0.cdc | sed -n '890,966p') <(git show origin/liob/split-v0-health-position-resources:cadence/contracts/FlowALPHealth.cdc |
sed -n '193,270p') | delta --side-by-side --file-style omit --line-fill-method ansi
diff -u -w <(git show origin/main:cadence/contracts/FlowALPv0.cdc | sed -n '970,1072p') <(git show origin/liob/split-v0-health-position-resources:cadence/contracts/FlowALPHealth.cdc |
sed -n '274,377p') | delta --side-by-side --file-style omit --line-fill-method ansi
diff -u -w <(git show origin/main:cadence/contracts/FlowALPv0.cdc | sed -n '2411,2658p') <(git show
origin/liob/split-v0-health-position-resources:cadence/contracts/FlowALPPositionResources.cdc | sed -n '21,268p') | delta --side-by-side --file-style omit --line-fill-method
ansi
diff -u -w <(git show origin/main:cadence/contracts/FlowALPv0.cdc | sed -n '2665,2709p') <(git show
origin/liob/split-v0-health-position-resources:cadence/contracts/FlowALPPositionResources.cdc | sed -n '275,319p') | delta --side-by-side --file-style omit --line-fill-method
ansi
I also added this follow-up which adds documentation to the FlowALPHealth functions: #185
Add documentation to FlowALPHealth and make interest index params optional
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
Why
This continues Jordan split strategy by reducing FlowALPv0 surface area and isolating pure calculation logic from resource-wrapper logic while preserving behavior.
Validation