Skip to content

refactor: finish cursor → actionId rename in internal libs (#128)#140

Merged
thedavidmeister merged 1 commit intomainfrom
feat/issue-128-finish-cursor-to-id-rename
May 4, 2026
Merged

refactor: finish cursor → actionId rename in internal libs (#128)#140
thedavidmeister merged 1 commit intomainfrom
feat/issue-128-finish-cursor-to-id-rename

Conversation

@thedavidmeister
Copy link
Copy Markdown
Contributor

@thedavidmeister thedavidmeister commented May 4, 2026

Summary

Follow-up to #139 finishing the rename in internal libs that were missed. PR #139 covered the public API surface; three internal-lib functions still used `cursor` for data crossing the call boundary, which #128's principle marks as the wrong name.

Renames:

  • `LibTotalSupply.onAccountMigrated`: `fromCursor`/`toCursor` → `fromActionId`/`toActionId` (mirrors the `AccountMigrated` event field names)
  • `LibRebase.migratedBalance`: `cursor` input → `fromActionId`, `newCursor` return → `toActionId`
  • `LibReceiptRebase.migratedBalance`: same shape as `LibRebase`

Stays as cursor (correct per convention):

  • `cursor` locals in `StoxReceipt` / `StoxReceiptVault` (walk-position, not data)
  • `accountIdCursor` mapping in `LibCorporateActionReceipt` (storage tracking walk progress over time)
  • `accountMigrationCursor` / `totalSupplyLatestCursor` in storage

Test plan

  • full suite green (497/497 pass)
  • static analysis (CI)
  • legal (CI)

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Refactor
    • Improved internal code organization and naming conventions for better maintainability. No functional changes or end-user impact.

Follow-up to #139. Three internal lib functions still used cursor for
data crossing the call boundary, which the issue's principle marks as
the wrong name (cursor = local-variable name during walks; actionId =
opaque handle as data).

- LibTotalSupply.onAccountMigrated: fromCursor/toCursor → fromActionId/toActionId
  (mirrors the AccountMigrated event field names)
- LibRebase.migratedBalance: cursor input → fromActionId,
  newCursor return → toActionId
- LibReceiptRebase.migratedBalance: same shape as LibRebase

Locals named cursor in StoxReceipt / StoxReceiptVault are correct per
the convention (walk-position, not data) and stay. The accountIdCursor
mapping in LibCorporateActionReceipt is storage tracking walk progress
over time and stays.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 4, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 4bc482ae-eb5f-4b5d-a131-fce82a9969ea

📥 Commits

Reviewing files that changed from the base of the PR and between 3fb2345 and 5cecc3a.

📒 Files selected for processing (3)
  • src/lib/LibRebase.sol
  • src/lib/LibReceiptRebase.sol
  • src/lib/LibTotalSupply.sol

📝 Walkthrough

Walkthrough

Three related library functions (LibRebase.migratedBalance, LibReceiptRebase.migratedBalance, and LibTotalSupply.onAccountMigrated) undergo coordinated parameter and return value renaming from cursor/newCursor terminology to fromActionId/toActionId. Control flow and logic remain unchanged; only naming and supporting NatSpec documentation are updated.

Changes

Migration Position Tracking API Renaming

Layer / File(s) Summary
Core Function Signatures
src/lib/LibRebase.sol, src/lib/LibReceiptRebase.sol, src/lib/LibTotalSupply.sol
Parameters renamed: cursorfromActionId, newCursor/toCursortoActionId. Return types and tuple structures remain identical. All three functions now use consistent migration-position naming.
NatSpec Documentation
src/lib/LibRebase.sol, src/lib/LibReceiptRebase.sol, src/lib/LibTotalSupply.sol
Documentation updated to reflect fromActionId and toActionId semantics. Loop initialization and traversal logic descriptions updated to align with renamed variables; balance migration accounting logic unchanged.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related issues

Possibly related PRs

Poem

🐰 ✨
From cursor to fromActionId we trace,
Where migrations hop through action space,
To toActionId they jump and land—
A semantic leap that readers understand!
🪃

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: finishing the cursor → actionId rename across internal library functions (LibRebase, LibReceiptRebase, LibTotalSupply).
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/issue-128-finish-cursor-to-id-rename

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
Review rate limit: 0/1 reviews remaining, refill in 60 minutes.

Comment @coderabbitai help to get the list of available commands and usage tips.

@thedavidmeister thedavidmeister merged commit 2019864 into main May 4, 2026
4 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.

1 participant