-
Notifications
You must be signed in to change notification settings - Fork 104
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-109] Add parent subaccount websocket #1463
[TRA-109] Add parent subaccount websocket #1463
Conversation
Important Auto Review SkippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the 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 (
|
}); | ||
|
||
it('Throws an error if the child subaccount number is greater than the max child subaccount number', () => { | ||
expect(() => getParentSubaccountNum(128001)).toThrowError('Child subaccount number must be less than 128000'); |
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.
nit: test edge case of 128000
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.
128000 isn't an edge case for errors, but the error message implies that. Updated the error message.
MAX_PARENT_SUBACCOUNTS, | ||
} from '../constants'; | ||
|
||
export function getParentSubaccountNum(childSubaccountNum: number): number { |
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.
Any reason to move this to a separate 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.
Is this so that it can be used by both comlink and socks?
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.
Yes, that's the reason.
@@ -417,6 +412,9 @@ export class Subscriptions { | |||
|
|||
return resolution !== undefined; | |||
} | |||
case (Channel.V4_PARENT_ACCOUNTS): { |
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.
Why is the channel called "ACCOUNT" vs "SUBACCOUNTS"
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.
No reason besides old code.
@Mergifyio backport release/indexer/v5.x |
✅ Backports have been created
|
(cherry picked from commit 355d9e9) # Conflicts: # indexer/services/socks/src/lib/message-forwarder.ts
Changelist
Update
socks
to be able to forward messages from a single topic to multiple websocket channels.Add V4 parent subaccounts channel and forward messages from subaccounts topic to the parent websocket channel.
Add subaccount number as a top-level value in the websocket messages forwarded to clients.
Misc:
TODO: Filtering out transfer messages from parent to a child / child to a child is not implemented.
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
.