Skip to content

Commit c59a566

Browse files
authored
fix: client options in ledger profiles (#111)
* fix: client options in ledger profiles * fix: test
1 parent a641a83 commit c59a566

File tree

2 files changed

+3
-20
lines changed

2 files changed

+3
-20
lines changed

packages/shared/lib/network.ts

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -302,19 +302,11 @@ export const buildClientOptions = (config: NetworkConfig): ClientOptions => ({
302302
})
303303

304304
export const getDefaultClientOptions = (): ClientOptions => {
305-
const { id, type } =
305+
const { id } =
306306
get(activeProfile)?.settings?.networkConfig.network || getOfficialNetwork(NetworkType.ChrysalisMainnet)
307307

308-
const node = getOfficialNodes(type)[0]
309-
node.isPrimary = true
310-
311308
return {
312-
node,
313-
nodes: getOfficialNodes(type).map((n) => ({ ...n, isPrimary: n.url === node.url })),
314-
network: id,
315-
automaticNodeSelection: true,
316-
includeOfficialNodes: true,
317-
localPow: true,
309+
network: id.includes('mainnet') ? 'mainnet' : 'testnet',
318310
}
319311
}
320312

packages/shared/lib/tests/network.test.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -84,16 +84,7 @@ describe('File: network.ts', () => {
8484
it('should return the client options of the active profile if present', () => {
8585
const clientOpts = getDefaultClientOptions()
8686
expect(clientOpts).toEqual(<ClientOptions>{
87-
network: 'chrysalis-mainnet',
88-
automaticNodeSelection: true,
89-
includeOfficialNodes: true,
90-
localPow: true,
91-
node: _buildNode(MAINNET_URLS[0], MAINNET, true, false),
92-
nodes: [
93-
_buildNode(MAINNET_URLS[0], MAINNET, true, false),
94-
_buildNode(MAINNET_URLS[1], MAINNET),
95-
_buildNode(MAINNET_URLS[2], MAINNET),
96-
],
87+
network: 'mainnet',
9788
})
9889
})
9990
})

0 commit comments

Comments
 (0)