feat(wallet): implement real EVM wallet connection lifecycle (V2-FE-006) - #287
Open
abdullahilateefat03-boop wants to merge 3 commits into
Open
Conversation
Contributor
|
resolve conflicts @abdullahilateefat03-boop |
- Resolved conflicts in useWallet.ts, useAccount.ts, and test files - Kept HEAD version (feat branch) EVM/Wagmi implementation - Resolved ClaimSubmissionForm.tsx to use wagmi connectors - Removed deleted transaction-simulator.ts - Fixed useAccount.test.ts extension to .tsx for JSX support
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.
closes #241
Summary
Implements V2-FE-006 — Real Wallet Connection Lifecycle for the
TruthBounty canonical Optimism/EVM runtime.
What changed
Replaced
hooks/useWallet.ts— mock balance hook replaced with canonical EVMlifecycle hook: connect, reconnect, disconnect, account-change detection,
connector-error state, hydration guard, connector-id preference persistence
hooks/useAccount.ts— Stellar/Freighter implementation replaced withwagmi useAccount wrapper; hydration-safe (null before mount), exposes
address, displayName, chainId
components/features/claim-submission/ClaimSubmissionForm.tsx— removed@stellar/freighter-api setAllowed(); replaced with wagmi useConnect /
useConnectors
Deleted
lib/mock-wagmi.ts— removed; wagmi's built-in mock connector used in testslib/mock-wallet-provider.tsx— removed; no synthetic wallet state remainslib/transaction-simulator.ts— removed; synthetic tx hashes are bannedper spec; production paths use wagmi writeContract
Added
src/__tests__/integration/wallet-lifecycle.test.tsx— integration testsat the Wagmi boundary: connect, disconnect, account-change, reconnect,
wrong-network, hydration safety, no synthetic state
Tests updated
hooks/tests/useWallet.test.tsx— lifecycle tests replacing mock balance testshooks/__tests__/useAccount.test.ts— EVM tests replacing Freighter mocksClaimSubmissionForm.wallet.test.tsx— wagmi connect mock replacing FreighterClaimSubmissionForm.modal.test.tsx— Freighter mock removedAcceptance criteria evidence
Security notes
Residual risks
as transitive entries; they can be removed with
pnpm removeonceconfirmed no other feature branch depends on them