Conversation
WalkthroughThe pull request introduces modifications to the Changes
Possibly related PRs
Poem
Finishing Touches
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 using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/eas/eas.service.ts (1)
172-172: LGTM! Consider extracting the metadata fallback logic.The metadata handling is now consistent with its usage in hash generation and encryption. However, to improve maintainability and reduce potential inconsistencies, consider extracting the metadata fallback logic into a helper method.
+ private getMetadataWithFallback(metadata: unknown): object { + return metadata || {}; + } async getSignedDelegatedAttestation( signDelegatedAttestationDto: SignDelegatedAttestationDto ) { // ... const key = generateHash( anyJwtPayload.sub, anyJwtPayload.provider, - anyJwtPayload.metadata || {} + this.getMetadataWithFallback(anyJwtPayload.metadata) ); const secret = await this.litService.encryptToJson( chainId, { id: anyJwtPayload.sub, provider: anyJwtPayload.provider, - metadata: anyJwtPayload.metadata || {}, + metadata: this.getMetadataWithFallback(anyJwtPayload.metadata), }, key, siweJwtPayload.sub as '0x${string}' ); // ... const encodedData = this.encodeAttestationData([ key, anyJwtPayload.provider, secret, - JSON.stringify(anyJwtPayload.metadata || {}, null, 0), + JSON.stringify(this.getMetadataWithFallback(anyJwtPayload.metadata), null, 0), ]);
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/eas/eas.service.ts(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Lint
Summary by CodeRabbit