-
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.
- Loading branch information
juraj.bacovcin
committed
Oct 11, 2024
1 parent
c089a5d
commit 87eaac2
Showing
5 changed files
with
52 additions
and
34 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,38 @@ | ||
import { Network, TatumSDK, Ton } from '../../../service' | ||
import { e2eUtil } from '../../e2e.util' | ||
|
||
const getTonClient = async (testnet: boolean) => { | ||
const getTonClient = async (testnet?: boolean) => { | ||
return await TatumSDK.init<Ton>(e2eUtil.initConfig(testnet ? Network.TON_TESTNET : Network.TON)) | ||
} | ||
|
||
describe('Ton', () => { | ||
[true, false].forEach(testnet => { | ||
describe(testnet ? 'Testnet' : 'Mainnet', () => { | ||
it('status', async () => { | ||
const ton = await getTonClient(testnet) | ||
const result = await ton.rpc.getBlockchainMasterchainHead() | ||
await ton.destroy() | ||
expect(result).toBeDefined() | ||
}) | ||
it('getMasterchainInfo', async () => { | ||
const ton = await getTonClient(testnet) | ||
const result = await ton.rpc.getMasterchainInfo() | ||
await ton.destroy() | ||
expect(result).toBeDefined() | ||
}) | ||
describe('Testnet', () => { | ||
it('Ton V2 API - status', async () => { | ||
const ton = await getTonClient(true) | ||
const result = await ton.rpc.getBlockchainMasterchainHead() | ||
await ton.destroy() | ||
expect(result).toBeDefined() | ||
}) | ||
it('Ton Http API - getMasterchainInfo', async () => { | ||
const ton = await getTonClient(true) | ||
const result = await ton.rpc.getMasterchainInfo() | ||
await ton.destroy() | ||
expect(result).toBeDefined() | ||
}) | ||
}) | ||
|
||
describe('Mainnet', () => { | ||
it.skip('Ton V2 API - status', async () => { | ||
const ton = await getTonClient() | ||
const result = await ton.rpc.getBlockchainMasterchainHead() | ||
await ton.destroy() | ||
expect(result).toBeDefined() | ||
}) | ||
it('Ton Http API - getMasterchainInfo', async () => { | ||
const ton = await getTonClient() | ||
const result = await ton.rpc.getMasterchainInfo() | ||
await ton.destroy() | ||
expect(result).toBeDefined() | ||
}) | ||
}) | ||
}) |
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