Skip to content

Commit

Permalink
feat: renamed variables
Browse files Browse the repository at this point in the history
  • Loading branch information
Polybius93 committed Nov 15, 2023
1 parent 8c18929 commit 8c5e0f1
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 27 deletions.
4 changes: 2 additions & 2 deletions src/app/common/hooks/use-bitcoin-contracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Check failure on line 85 in src/app/common/hooks/use-bitcoin-contracts.ts

View workflow job for this annotation

GitHub Actions / typecheck

Expected 4 arguments, but got 5.

Check failure on line 85 in src/app/common/hooks/use-bitcoin-contracts.ts

View workflow job for this annotation

GitHub Actions / typecheck

Cannot find name 'attestorURLs'.
);

Expand Down
8 changes: 4 additions & 4 deletions src/app/features/add-network/add-network.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,

Check failure on line 181 in src/app/features/add-network/add-network.tsx

View workflow job for this annotation

GitHub Actions / typecheck

An object literal cannot have multiple properties with the same name.
});
navigate(RouteUrls.Home);
} else if (chainId === ChainID.Mainnet || chainId === ChainID.Testnet) {
Expand All @@ -187,8 +187,8 @@ export function AddNetwork() {
name: name,
chainId: chainId,
url: stacksPath,
bitcoinNetwork: bitcoinApi,
bitcoinUrl: bitcoinPath,
network: bitcoinApi,
url: bitcoinPath,

Check failure on line 191 in src/app/features/add-network/add-network.tsx

View workflow job for this annotation

GitHub Actions / typecheck

An object literal cannot have multiple properties with the same name.
});
navigate(RouteUrls.Home);
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/app/store/common/api-clients.hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
10 changes: 5 additions & 5 deletions src/app/store/networks/networks.hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,18 @@ export function useNetworksActions() {
name,
chainId,
subnetChainId,
url,
bitcoinNetwork,
bitcoinUrl,
url: stacksUrl,
network,
url: bitcoinUrl,
}: PersistedNetworkConfiguration) {
dispatch(
networksActions.addNetwork({
id,
name,
chainId,
subnetChainId,
url,
bitcoinNetwork,
stacksUrl,
network,
bitcoinUrl,
})
);
Expand Down
6 changes: 3 additions & 3 deletions src/app/store/networks/networks.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -54,13 +54,13 @@ export function transformNetworkStateToMultichainStucture(
chain: {
stacks: {
blockchain: 'stacks',
url: url,
url: stacksUrl,
chainId,
subnetChainId,
},
bitcoin: {
blockchain: 'bitcoin',
bitcoinNetwork,
network: bitcoinNetwork,
bitcoinUrl,
},
},
Expand Down
24 changes: 12 additions & 12 deletions src/shared/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ interface BaseChainConfig {

interface BitcoinChainConfig extends BaseChainConfig {
blockchain: 'bitcoin';
bitcoinUrl: string;
bitcoinNetwork: BitcoinNetworkModes;
url: string;
network: BitcoinNetworkModes;
}

interface StacksChainConfig extends BaseChainConfig {
Expand Down Expand Up @@ -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,
},
},
};
Expand All @@ -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,
},
},
};
Expand All @@ -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,
},
},
};
Expand All @@ -149,8 +149,8 @@ const networkSbtcDevenv: NetworkConfiguration = {
},
bitcoin: {
blockchain: 'bitcoin',
bitcoinNetwork: 'regtest',
bitcoinUrl: 'http://localhost:8999/api',
network: 'regtest',
url: 'http://localhost:8999/api',
},
},
};
Expand All @@ -166,8 +166,8 @@ const networkDevnet: NetworkConfiguration = {
},
bitcoin: {
blockchain: 'bitcoin',
bitcoinNetwork: 'regtest',
bitcoinUrl: 'http://localhost:18443',
network: 'regtest',
url: 'http://localhost:18443',
},
},
};
Expand Down

0 comments on commit 8c5e0f1

Please sign in to comment.