-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TRA-112] Add util to convert between parent and child subaccount numbers #1171
Conversation
Signed-off-by: Shrenuj Bansal <[email protected]>
WalkthroughThe recent updates involve enhancing the Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 2
Configuration used: CodeRabbit UI
Files selected for processing (3)
- indexer/packages/postgres/tests/lib/api-translations.test.ts (2 hunks)
- indexer/packages/postgres/src/constants.ts (1 hunks)
- indexer/packages/postgres/src/lib/api-translations.ts (2 hunks)
Additional comments: 5
indexer/packages/postgres/__tests__/lib/api-translations.test.ts (4)
- 40-47: The tests for
getChildSubaccountNums
correctly verify the functionality under normal conditions. However, given the logical error in thegetChildSubaccountNums
function implementation, these tests might pass incorrectly. Ensure the function implementation is corrected as suggested.- 50-53: The test for error handling in
getChildSubaccountNums
when the parent subaccount number exceeds the maximum is well-implemented. However, ensure the error message aligns with the corrected logic in the function implementation.- 56-61: The tests for
getParentSubaccountNum
correctly verify the functionality under normal conditions. However, given the logical error in thegetParentSubaccountNum
function implementation, these tests might pass incorrectly. Ensure the function implementation is corrected as suggested.- 64-67: The test for error handling in
getParentSubaccountNum
when the child subaccount number exceeds the maximum is well-implemented. However, ensure the error message aligns with the corrected logic in the function implementation.indexer/packages/postgres/src/constants.ts (1)
- 125-127: The constants
MAX_PARENT_SUBACCOUNTS
andCHILD_SUBACCOUNT_MULTIPLIER
are correctly defined and align with the requirements for subaccount number conversions. Ensure their values are consistent with the system's design and limitations.
Signed-off-by: Shrenuj Bansal <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (1)
- indexer/packages/postgres/tests/lib/api-translations.test.ts (2 hunks)
Files skipped from review as they are similar to previous changes (1)
- indexer/packages/postgres/tests/lib/api-translations.test.ts
Signed-off-by: Shrenuj Bansal <[email protected]>
indexer/packages/postgres/__tests__/lib/api-translations.test.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (1)
- indexer/packages/postgres/src/lib/api-translations.ts (2 hunks)
Files skipped from review as they are similar to previous changes (1)
- indexer/packages/postgres/src/lib/api-translations.ts
Signed-off-by: Shrenuj Bansal <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (2)
- indexer/packages/postgres/tests/lib/api-translations.test.ts (2 hunks)
- indexer/packages/postgres/src/lib/api-translations.ts (2 hunks)
Files skipped from review as they are similar to previous changes (2)
- indexer/packages/postgres/tests/lib/api-translations.test.ts
- indexer/packages/postgres/src/lib/api-translations.ts
Signed-off-by: Shrenuj Bansal <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (1)
- indexer/packages/postgres/tests/lib/api-translations.test.ts (2 hunks)
Files skipped from review as they are similar to previous changes (1)
- indexer/packages/postgres/tests/lib/api-translations.test.ts
Changelist
Add utils to provide conversions between parent (user-level) subaccount numbers and child (protocol-level) subaccount numbers
Test Plan
Unit tests
Author/Reviewer Checklist
state-breaking
label.indexer-postgres-breaking
label.PrepareProposal
orProcessProposal
, manually add the labelproposal-breaking
.feature:[feature-name]
.backport/[branch-name]
.refactor
,chore
,bug
.