From 8c5e0f165e156693d15607d4ffbcd6df9131e21c Mon Sep 17 00:00:00 2001 From: Polybius93 Date: Wed, 1 Nov 2023 09:59:27 +0100 Subject: [PATCH] feat: renamed variables --- src/app/common/hooks/use-bitcoin-contracts.ts | 4 ++-- src/app/features/add-network/add-network.tsx | 8 +++---- src/app/store/common/api-clients.hooks.ts | 2 +- src/app/store/networks/networks.hooks.ts | 10 ++++---- src/app/store/networks/networks.utils.ts | 6 ++--- src/shared/constants.ts | 24 +++++++++---------- 6 files changed, 27 insertions(+), 27 deletions(-) diff --git a/src/app/common/hooks/use-bitcoin-contracts.ts b/src/app/common/hooks/use-bitcoin-contracts.ts index 74e928ea38a..f535d8426d9 100644 --- a/src/app/common/hooks/use-bitcoin-contracts.ts +++ b/src/app/common/hooks/use-bitcoin-contracts.ts @@ -80,8 +80,8 @@ export function useBitcoinContracts() { const bitcoinContractInterface = await JsDLCInterface.new( bytesToHex(currentAddressPrivateKey), currentAddress, - currentBitcoinNetwork.chain.bitcoin.bitcoinNetwork, - currentBitcoinNetwork.chain.bitcoin.bitcoinUrl, + currentBitcoinNetwork.chain.bitcoin.network, + currentBitcoinNetwork.chain.bitcoin.url, JSON.stringify(attestorURLs) ); diff --git a/src/app/features/add-network/add-network.tsx b/src/app/features/add-network/add-network.tsx index 139b5a26e5b..c40f3592fbc 100644 --- a/src/app/features/add-network/add-network.tsx +++ b/src/app/features/add-network/add-network.tsx @@ -177,8 +177,8 @@ export function AddNetwork() { chainId: parentChainId, // Used for differentiating control flow in the wallet subnetChainId: chainId, // Used for signing transactions (via the network object, not to be confused with the NetworkConfigurations) url: stacksPath, - bitcoinNetwork: bitcoinApi, - bitcoinUrl: bitcoinPath, + network: bitcoinApi, + url: bitcoinPath, }); navigate(RouteUrls.Home); } else if (chainId === ChainID.Mainnet || chainId === ChainID.Testnet) { @@ -187,8 +187,8 @@ export function AddNetwork() { name: name, chainId: chainId, url: stacksPath, - bitcoinNetwork: bitcoinApi, - bitcoinUrl: bitcoinPath, + network: bitcoinApi, + url: bitcoinPath, }); navigate(RouteUrls.Home); } else { diff --git a/src/app/store/common/api-clients.hooks.ts b/src/app/store/common/api-clients.hooks.ts index 90482ad8885..cb0dc96414a 100644 --- a/src/app/store/common/api-clients.hooks.ts +++ b/src/app/store/common/api-clients.hooks.ts @@ -18,7 +18,7 @@ import { useCurrentNetworkState } from '../networks/networks.hooks'; export function useBitcoinClient() { const network = useCurrentNetworkState(); - return new BitcoinClient(network.chain.bitcoin.bitcoinUrl); + return new BitcoinClient(network.chain.bitcoin.url); } // Unanchored by default (microblocks) diff --git a/src/app/store/networks/networks.hooks.ts b/src/app/store/networks/networks.hooks.ts index 0b962b54fea..0a280d86931 100644 --- a/src/app/store/networks/networks.hooks.ts +++ b/src/app/store/networks/networks.hooks.ts @@ -55,9 +55,9 @@ export function useNetworksActions() { name, chainId, subnetChainId, - url, - bitcoinNetwork, - bitcoinUrl, + url: stacksUrl, + network, + url: bitcoinUrl, }: PersistedNetworkConfiguration) { dispatch( networksActions.addNetwork({ @@ -65,8 +65,8 @@ export function useNetworksActions() { name, chainId, subnetChainId, - url, - bitcoinNetwork, + stacksUrl, + network, bitcoinUrl, }) ); diff --git a/src/app/store/networks/networks.utils.ts b/src/app/store/networks/networks.utils.ts index fe3e74e15f0..2c698441198 100644 --- a/src/app/store/networks/networks.utils.ts +++ b/src/app/store/networks/networks.utils.ts @@ -44,7 +44,7 @@ export function transformNetworkStateToMultichainStucture( Object.entries(state) .map(([key, network]) => { if (!network) return ['', null]; - const { id, name, chainId, subnetChainId, url, bitcoinNetwork, bitcoinUrl } = network; + const { id, name, chainId, subnetChainId, url: stacksUrl, network: bitcoinNetwork, url: bitcoinUrl } = network; return [ key, @@ -54,13 +54,13 @@ export function transformNetworkStateToMultichainStucture( chain: { stacks: { blockchain: 'stacks', - url: url, + url: stacksUrl, chainId, subnetChainId, }, bitcoin: { blockchain: 'bitcoin', - bitcoinNetwork, + network: bitcoinNetwork, bitcoinUrl, }, }, diff --git a/src/shared/constants.ts b/src/shared/constants.ts index a2ce8da6e46..a605d39969d 100644 --- a/src/shared/constants.ts +++ b/src/shared/constants.ts @@ -57,8 +57,8 @@ interface BaseChainConfig { interface BitcoinChainConfig extends BaseChainConfig { blockchain: 'bitcoin'; - bitcoinUrl: string; - bitcoinNetwork: BitcoinNetworkModes; + url: string; + network: BitcoinNetworkModes; } interface StacksChainConfig extends BaseChainConfig { @@ -98,8 +98,8 @@ const networkMainnet: NetworkConfiguration = { }, bitcoin: { blockchain: 'bitcoin', - bitcoinNetwork: 'mainnet', - bitcoinUrl: BITCOIN_API_BASE_URL_MAINNET, + network: 'mainnet', + url: BITCOIN_API_BASE_URL_MAINNET, }, }, }; @@ -115,8 +115,8 @@ const networkTestnet: NetworkConfiguration = { }, bitcoin: { blockchain: 'bitcoin', - bitcoinNetwork: 'testnet', - bitcoinUrl: BITCOIN_API_BASE_URL_TESTNET, + network: 'testnet', + url: BITCOIN_API_BASE_URL_TESTNET, }, }, }; @@ -132,8 +132,8 @@ const networkSignet: NetworkConfiguration = { }, bitcoin: { blockchain: 'bitcoin', - bitcoinNetwork: 'signet', - bitcoinUrl: BITCOIN_API_BASE_URL_SIGNET, + network: 'signet', + url: BITCOIN_API_BASE_URL_SIGNET, }, }, }; @@ -149,8 +149,8 @@ const networkSbtcDevenv: NetworkConfiguration = { }, bitcoin: { blockchain: 'bitcoin', - bitcoinNetwork: 'regtest', - bitcoinUrl: 'http://localhost:8999/api', + network: 'regtest', + url: 'http://localhost:8999/api', }, }, }; @@ -166,8 +166,8 @@ const networkDevnet: NetworkConfiguration = { }, bitcoin: { blockchain: 'bitcoin', - bitcoinNetwork: 'regtest', - bitcoinUrl: 'http://localhost:18443', + network: 'regtest', + url: 'http://localhost:18443', }, }, };