refactor: rename cursor params/returns to actionId on public API (#128)#139
Conversation
…128) The traversal getters in ICorporateActionsV1 named their uint256 param/return as cursor / nextCursor / prevCursor. The value passed in and out is an action index — "cursor" describes the role of a local variable holding that index during a walk, not the value itself. Public surface renames: - nextOfType / prevOfType first param: cursor → fromIndex - nextOfType return: nextCursor → nextActionIndex - prevOfType return: prevCursor → prevActionIndex - latestActionOfType / earliestActionOfType return: cursor → actionIndex - getActionParameters param: cursor → actionIndex - AccountMigrated / ReceiptAccountMigrated event fields: fromCursor → fromActionIndex, toCursor → toActionIndex - LibCorporateActionNode internal fns matching the interface shape Out of scope (per #128, legitimately called cursor): - accountMigrationCursor / accountIdCursor / totalSupplyLatestCursor (storage variables holding state-machine progress over time) - LibRebase / LibReceiptRebase migratedBalance internal params (cursor as local walk variable) - Caller code is free to assign returns into a local called cursor Bytecode-neutral: event sig keccaks use type strings, not param names; metadata is pinned off via bytecode_hash="none" / cbor_metadata=false. Pointer codehash tests confirm zero deployment-bytecode change. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Warning Rate limit exceeded
To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (7)
📝 WalkthroughWalkthroughA refactoring PR that renames identifiers throughout the corporate actions API to replace generic ChangesCorporate Actions Naming Consolidation
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~8 minutes Possibly related issues
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Review rate limit: 0/1 reviews remaining, refill in 29 minutes and 44 seconds.Comment |
Switch from "index" (sequential / array-like, implies consumers can reason about ordering) to "id" (opaque handle, matching ERC721/1155 tokenId precedent). The corporate-action uint256 IS an array index internally, but externally consumers should treat it as an opaque handle: cancelled nodes leave gaps, the bootstrap is at idx 0, and ordering carries no semantic meaning beyond "look up this slot". This also corrects the existing actionIndex usage on schedule/cancel (pre-existing misnaming) — those now match the same convention. Renames: - actionIndex → actionId (incl. schedule/cancel/error/event params) - fromIndex → fromId (traversal first param) - nextActionIndex → nextActionId - prevActionIndex → prevActionId - fromActionIndex → fromActionId (event field) - toActionIndex → toActionId (event field) - NatSpec: "action index" → "action id" prose Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The renamed API uses two terms for the same uint256: actionId (opaque handle, crosses API boundary) and cursor (local-variable name for a walking pointer in a traversal loop). The example code uses cursor without explaining why — add a Naming Convention block to the QUERYING section so external consumers understand the distinction rather than guessing from precedent. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Summary
Implements #128: rename
cursor→actionIdon the public API, treating the value as an opaque handle (ERC721/1155tokenIdprecedent). Also corrects the existing pre-existingactionIndexusage on schedule/cancel — "index" implied sequential array behavior consumers might reason about; "id" makes the opacity contract explicit.Renames:
nextOfType/prevOfTypefirst param:cursor→fromIdnextOfTypereturn:nextCursor→nextActionIdprevOfTypereturn:prevCursor→prevActionIdlatestActionOfType/earliestActionOfTypereturn:cursor→actionIdgetActionParametersparam:cursor→actionIdschedule/cancel/CorporateActionScheduled/CorporateActionCancelled:actionIndex→actionId(pre-existing misnaming)AccountMigrated/ReceiptAccountMigratedevent fields:fromCursor→fromActionId,toCursor→toActionIdActionAlreadyComplete/ActionDoesNotExist: paramactionIndex→actionIdLibCorporateActionNodeinternal fns matching the interface shapeOut of scope (per #128 carve-out — legitimately called
cursor):accountMigrationCursor/accountIdCursor/totalSupplyLatestCursorstorageLibRebase/LibReceiptRebasemigratedBalanceinternal params (cursor as local walk variable)Bytecode impact
Zero. Event sig keccaks use type strings, not param names.
bytecode_hash = "none"+cbor_metadata = falsekeep param-name changes out of deployment bytecode. The pointer codehash suite (testCodehash*/testCreationCode*/testRuntimeCode*) passes without pointer regen.Test plan
🤖 Generated with Claude Code