Skip to content

Conversation

@AntonioVentilii
Copy link
Collaborator

Motivation

It is useful to have a common derived store for the current address store for the selected network.

@AntonioVentilii AntonioVentilii requested a review from a team as a code owner November 13, 2025 14:33
Copilot AI review requested due to automatic review settings November 13, 2025 14:33
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces a common derived store networkAddressStore that provides the appropriate address store based on the currently selected network. This simplifies address management in components by consolidating network-specific address store selection logic into a single reusable derived store.

  • Adds networkAddressStore that dynamically returns the correct address store (BTC, ETH, or SOL) based on the active network
  • Updates BtcReceive.svelte and SolReceive.svelte to use the new common store instead of manually selecting network-specific stores
  • Adds comprehensive test coverage for all supported networks (Bitcoin mainnet/testnet/regtest, Ethereum/Sepolia/Base/Polygon, Solana mainnet/devnet/local)

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
src/frontend/src/lib/derived/network-address.derived.ts Introduces networkAddressStore that selects the appropriate address store based on network ID using conditional logic for all supported networks
src/frontend/src/btc/components/receive/BtcReceive.svelte Refactors to use networkAddressStore instead of manually selecting between BTC address stores
src/frontend/src/sol/components/receive/SolReceive.svelte Refactors to use networkAddressStore and removes now-unnecessary imports
src/frontend/src/tests/lib/derived/network-address.derived.spec.ts Expands tests to cover networkAddressStore for all supported networks with comprehensive test cases

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@roman-nazaruk roman-nazaruk left a comment

Choose a reason for hiding this comment

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

LGTM, thnx

@AntonioVentilii AntonioVentilii added this pull request to the merge queue Nov 14, 2025
Merged via the queue into main with commit 55893e3 Nov 14, 2025
85 checks passed
@AntonioVentilii AntonioVentilii deleted the feat-frontend/Common-derived-store-for-network-address-store branch November 14, 2025 07:30
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.

2 participants