chore: tighten topic parameter types in request client API#1694
Open
Olexandr88 wants to merge 1 commit intoRequestNetwork:masterfrom
Open
chore: tighten topic parameter types in request client API#1694Olexandr88 wants to merge 1 commit intoRequestNetwork:masterfrom
Olexandr88 wants to merge 1 commit intoRequestNetwork:masterfrom
Conversation
Signed-off-by: Olexandr88 <radole1203@gmail.com>
Contributor
WalkthroughType signatures for two public methods in the RequestNetwork class were refined. The Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 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. Comment |
Contributor
Greptile OverviewGreptile SummaryReplaced
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Client
participant RequestNetwork
participant RequestLogic
participant Utils
participant TransactionManager
Note over Client,TransactionManager: Type Flow: IdentityTypes.IIdentity | string
Client->>RequestNetwork: fromTopic(topic: IdentityTypes.IIdentity | string)
Note over RequestNetwork: topic can be an IIdentity object or string
RequestNetwork->>RequestLogic: getRequestsByTopic(topic: string)
Note over RequestLogic: Expects string parameter
RequestLogic->>Utils: normalizeKeccak256Hash(topic: unknown)
Note over Utils: Accepts any type (unknown)
Utils->>Utils: normalize(data)
Utils->>Utils: keccak256Hash(normalized)
Utils-->>RequestLogic: hashedTopic
RequestLogic->>TransactionManager: getChannelsByTopic(hashedTopic)
TransactionManager-->>RequestLogic: channels
RequestLogic-->>RequestNetwork: requests
RequestNetwork-->>Client: Request[]
Note over Client,TransactionManager: Similar flow for fromMultipleTopics with Array type
|
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.
This improves type safety for (fromTopic) and (fromMultipleTopics) by replacing any with the actual supported input types IdentityTypes.IIdentity | string
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.