fix: hardcord the failed script#1246
Conversation
PR SummaryReplaced the delegated Flow identifier retrieval with a direct implementation that fetches and executes Cadence scripts. The change involves decoding base64 encoded scripts and executing them through FCL (Flow Client Library) queries, providing better control over the identifier retrieval process. Changes
autogenerated by presubmit.ai |
There was a problem hiding this comment.
🚨 Pull request needs attention.
Review Summary
Files Processed (1)
- src/background/controller/wallet.ts (1 hunk)
Actionable Comments (1)
-
src/background/controller/wallet.ts [1113-1113]
possible issue: "Add null check for network property"
Skipped Comments (1)
-
src/background/controller/wallet.ts [1122-1126]
best practice: "Add error handling for FCL query"
| getAssociatedFlowIdentifier = async (address: string): Promise<string> => { | ||
| const network = await userWalletService.getNetwork(); | ||
| const allScripts = await openapiService.getCadenceScripts(); | ||
| const encodedScript = allScripts.scripts[network]?.bridge?.getAssociatedFlowIdentifier; |
There was a problem hiding this comment.
The code accesses allScripts.scripts[network]?.bridge without first checking if allScripts.scripts[network] exists. While the optional chaining on .bridge helps, you should add a check for the network existence to provide a more specific error message if the network is not supported.
Closes #1244
Related Issue
Closes #1244
Summary of Changes
Need Regression Testing
Risk Assessment
Additional Notes
Screenshots (if applicable)