-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ALL-9108 Refactor and fix some existing tests
- Loading branch information
juraj.bacovcin
committed
Oct 11, 2024
1 parent
5d070cc
commit 8b23a5e
Showing
11 changed files
with
78 additions
and
57 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,45 @@ | ||
import { Network } from '../dto' | ||
import { Bitcoin, TatumSDK } from '../service' | ||
import { ApiKey } from './e2e.constant' | ||
|
||
describe('Tatum Init', () => { | ||
describe('IP auth', () => { | ||
it('Testnet', async () => { | ||
const tatum = await TatumSDK.init<Bitcoin>({ | ||
network: Network.BITCOIN_TESTNET, | ||
}) | ||
const { result } = await tatum.rpc.getBlockChainInfo() | ||
expect(result.chain).toBe('test') | ||
await tatum.destroy() | ||
it('Testnet', async () => { | ||
const tatum = await TatumSDK.init<Bitcoin>({ | ||
network: Network.BITCOIN_TESTNET, | ||
apiKey: ApiKey.testnet, | ||
}) | ||
const { result } = await tatum.rpc.getBlockChainInfo() | ||
expect(result.chain).toBe('test') | ||
await tatum.destroy() | ||
}) | ||
|
||
it('Mainnet', async () => { | ||
const tatum = await TatumSDK.init<Bitcoin>({ | ||
network: Network.BITCOIN, | ||
}) | ||
const { result } = await tatum.rpc.getBlockChainInfo() | ||
expect(result.chain).toBe('main') | ||
await tatum.destroy() | ||
it('Mainnet', async () => { | ||
const tatum = await TatumSDK.init<Bitcoin>({ | ||
network: Network.BITCOIN, | ||
apiKey: ApiKey.mainnet, | ||
}) | ||
const { result } = await tatum.rpc.getBlockChainInfo() | ||
expect(result.chain).toBe('main') | ||
await tatum.destroy() | ||
}) | ||
|
||
describe('Multiple Instances', () => { | ||
it('IP auth', async () => { | ||
const mainnet = await TatumSDK.init<Bitcoin>({ | ||
network: Network.BITCOIN, | ||
}) | ||
const testnet = await TatumSDK.init<Bitcoin>({ | ||
network: Network.BITCOIN_TESTNET, | ||
}) | ||
it('Multiple Instances', async () => { | ||
const mainnet = await TatumSDK.init<Bitcoin>({ | ||
network: Network.BITCOIN, | ||
apiKey: ApiKey.mainnet, | ||
}) | ||
const testnet = await TatumSDK.init<Bitcoin>({ | ||
network: Network.BITCOIN_TESTNET, | ||
apiKey: ApiKey.testnet, | ||
}) | ||
|
||
const { result: resultMainnet } = await mainnet.rpc.getBlockChainInfo() | ||
expect(resultMainnet.chain).toBe('main') | ||
const { result: resultMainnet } = await mainnet.rpc.getBlockChainInfo() | ||
expect(resultMainnet.chain).toBe('main') | ||
|
||
const { result: resultTestnet } = await testnet.rpc.getBlockChainInfo() | ||
expect(resultTestnet.chain).toBe('test') | ||
const { result: resultTestnet } = await testnet.rpc.getBlockChainInfo() | ||
expect(resultTestnet.chain).toBe('test') | ||
|
||
await testnet.destroy() | ||
await mainnet.destroy() | ||
}) | ||
await testnet.destroy() | ||
await mainnet.destroy() | ||
}) | ||
}) |