Skip to content
This repository was archived by the owner on Mar 2, 2026. It is now read-only.

fix: hardcord the failed script#1246

Merged
zzggo merged 1 commit into
masterfrom
1244-hotfix-unable-to-addwatch-custom-ft-to-flow-wallet-extension
Sep 1, 2025
Merged

fix: hardcord the failed script#1246
zzggo merged 1 commit into
masterfrom
1244-hotfix-unable-to-addwatch-custom-ft-to-flow-wallet-extension

Conversation

@zzggo

@zzggo zzggo commented Sep 1, 2025

Copy link
Copy Markdown
Collaborator

Closes #1244

Related Issue

Closes #1244

Summary of Changes

Need Regression Testing

  • Yes
  • No

Risk Assessment

  • Low
  • Medium
  • High

Additional Notes

Screenshots (if applicable)

@github-actions

github-actions Bot commented Sep 1, 2025

Copy link
Copy Markdown

PR Summary

Replaced 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

File Summary
src/background/controller/wallet.ts Replaced getAssociatedFlowIdentifier implementation to directly fetch Cadence scripts from the API, decode them from base64, and execute via FCL query. Added network-aware script retrieval and proper error handling for missing scripts.

autogenerated by presubmit.ai

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚨 Pull request needs attention.

Review Summary

Commits Considered (1)
  • 93c9922: fix: hardcord the failed script

Closes #1244

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;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@zzggo zzggo merged commit aa053f5 into master Sep 1, 2025
11 of 12 checks passed
@zzggo zzggo deleted the 1244-hotfix-unable-to-addwatch-custom-ft-to-flow-wallet-extension branch September 1, 2025 05:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants