Skip to content

fix(wallet): reuse getNetworkPassphrase from lib/stellar.ts in signTransaction (#48) - #107

Open
ghzhost wants to merge 1 commit into
StellarSend:mainfrom
ghzhost:fix/walletcontext-reuse-getnetworkpassphrase-48
Open

fix(wallet): reuse getNetworkPassphrase from lib/stellar.ts in signTransaction (#48)#107
ghzhost wants to merge 1 commit into
StellarSend:mainfrom
ghzhost:fix/walletcontext-reuse-getnetworkpassphrase-48

Conversation

@ghzhost

@ghzhost ghzhost commented Sep 3, 2026

Copy link
Copy Markdown

Summary

Closes #48.

Replaces the hardcoded literal network passphrase strings in WalletContext.tsx's signTransaction with the SDK-backed getNetworkPassphrase(wallet.network) helper from src/lib/stellar.ts.

Changes

  • In src/context/WalletContext.tsx:
    • Imported getNetworkPassphrase from @/lib/stellar.
    • Replaced literal ternary string assignment with const networkPassphrase = getNetworkPassphrase(wallet.network).
  • In src/context/WalletContext.test.tsx:
    • Added unit test verifying signTransaction invokes Freighter's signTransaction with the exact SDK-backed network passphrase for both testnet and mainnet.

Validation

  • All 114 vitest unit/integration tests passing across the suite (NODE_ENV=development npx vitest run).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

WalletContext hardcodes the Stellar network passphrase inline instead of reusing lib/stellar.ts's SDK-backed getNetworkPassphrase

1 participant