Skip to content

Commit

Permalink
ALL-9108 Fix further tests
Browse files Browse the repository at this point in the history
  • Loading branch information
juraj.bacovcin committed Oct 11, 2024
1 parent c089a5d commit 87eaac2
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 34 deletions.
24 changes: 13 additions & 11 deletions src/e2e/rpc/evm/eth/tatum.rpc.beacon.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,67 +5,69 @@ import { EvmE2eUtils } from '../evm.e2e.utils'

describe('Beacon', () => {
describe('v1', () => {
const networks = [Network.ETHEREUM_HOLESKY, Network.ETHEREUM_SEPOLIA, Network.ETHEREUM]
const networks = [Network.ETHEREUM_HOLESKY, Network.ETHEREUM]

describe.each(networks)('%s', (network) => {
it('should get node version', async () => {
const tatum = await EvmE2eUtils.initTatum<Ethereum>(network, ApiKey.testnet)
const apiKey = network === Network.ETHEREUM ? ApiKey.mainnet : ApiKey.testnet

it.skip('should get node version', async () => {
const tatum = await EvmE2eUtils.initTatum<Ethereum>(network, apiKey)
const { data } = await tatum.rpc.beacon.v1.getNodeVersion()
await tatum.destroy()
expect(data).toBeDefined()
})

it('should get genesis', async () => {
const tatum = await EvmE2eUtils.initTatum<Ethereum>(network, ApiKey.testnet)
const tatum = await EvmE2eUtils.initTatum<Ethereum>(network, apiKey)
const { data } = await tatum.rpc.beacon.v1.getGenesis()
await tatum.destroy()
expect(data).toBeDefined()
})

it('should get state root', async () => {
const tatum = await EvmE2eUtils.initTatum<Ethereum>(network, ApiKey.testnet)
const tatum = await EvmE2eUtils.initTatum<Ethereum>(network, apiKey)
const { data } = await tatum.rpc.beacon.v1.getStateRoot({ stateId: 'head' })
await tatum.destroy()
expect(data).toBeDefined()
})

it('should get block headers', async () => {
const tatum = await EvmE2eUtils.initTatum<Ethereum>(network, ApiKey.testnet)
const tatum = await EvmE2eUtils.initTatum<Ethereum>(network, apiKey)
const { data } = await tatum.rpc.beacon.v1.getBlockHeaders({ slot: '1000' })
await tatum.destroy()
expect(data).toBeDefined()
})

it('should get block root', async () => {
const tatum = await EvmE2eUtils.initTatum<Ethereum>(network, ApiKey.testnet)
const tatum = await EvmE2eUtils.initTatum<Ethereum>(network, apiKey)
const { data } = await tatum.rpc.beacon.v1.getBlockRoot({ blockId: 'head' })
await tatum.destroy()
expect(data).toBeDefined()
})

it('should get state committees', async () => {
const tatum = await EvmE2eUtils.initTatum<Ethereum>(network, ApiKey.testnet)
const tatum = await EvmE2eUtils.initTatum<Ethereum>(network, apiKey)
const { data } = await tatum.rpc.beacon.v1.getStateCommittees({ stateId: 'head' })
await tatum.destroy()
expect(data).toBeDefined()
})

it('should get state finality checkpoints', async () => {
const tatum = await EvmE2eUtils.initTatum<Ethereum>(network, ApiKey.testnet)
const tatum = await EvmE2eUtils.initTatum<Ethereum>(network, apiKey)
const { data } = await tatum.rpc.beacon.v1.getStateFinalityCheckpoints({ stateId: 'head' })
await tatum.destroy()
expect(data).toBeDefined()
})

it('should get state fork', async () => {
const tatum = await EvmE2eUtils.initTatum<Ethereum>(network, ApiKey.testnet)
const tatum = await EvmE2eUtils.initTatum<Ethereum>(network, apiKey)
const { data } = await tatum.rpc.beacon.v1.getStateFork({ stateId: 'head' })
await tatum.destroy()
expect(data).toBeDefined()
})

it('should get state sync committees', async () => {
const tatum = await EvmE2eUtils.initTatum<Ethereum>(network, ApiKey.testnet)
const tatum = await EvmE2eUtils.initTatum<Ethereum>(network, apiKey)
const { data } = await tatum.rpc.beacon.v1.getStateSyncCommittees({ stateId: 'head' })
await tatum.destroy()
expect(data).toBeDefined()
Expand Down
12 changes: 6 additions & 6 deletions src/e2e/rpc/evm/evm.rpc.spec.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
import { Network } from '../../../dto'
import { ApiKey, ApiKeyV3 } from '../../e2e.constant'
import { ApiKey } from '../../e2e.constant'
import { EvmE2eUtils } from './evm.e2e.utils'

const testNetworks = [
{ network: Network.CELO },
{ network: Network.CELO_ALFAJORES },
// { network: Network.ARBITRUM_ONE },
{ network: Network.ARBITRUM_NOVA, apiKey: ApiKeyV3.mainnet },
{ network: Network.ARBITRUM_NOVA, apiKey: ApiKey.mainnet },
{
network: Network.ARBITRUM_NOVA_TESTNET,
apiKey: process.env.V3_API_KEY_TESTNET,
apiKey: ApiKey.testnet,
},
{ network: Network.HORIZEN_EON },
// { network: Network.HORIZEN_EON_GOBI },
{ network: Network.CHILIZ },
{ network: Network.BINANCE_SMART_CHAIN },
{
network: Network.BINANCE_SMART_CHAIN_TESTNET,
apiKey: process.env.V3_API_KEY_TESTNET,
apiKey: ApiKey.testnet,
},
{ network: Network.FLARE },
{ network: Network.FLARE_SONGBIRD },
Expand Down Expand Up @@ -50,7 +50,7 @@ const testNetworks = [
{
network: Network.TRON_SHASTA,
skipEstimateGas: true,
apiKey: process.env.V3_API_KEY_TESTNET,
apiKey: ApiKey.testnet,
},
{
network: Network.KLAYTN,
Expand All @@ -70,7 +70,7 @@ const testNetworks = [
network: Network.XINFIN,
},
// { network: Network.CRONOS },
{ network: Network.CRONOS_TESTNET, apiKey: process.env.V3_API_KEY_TESTNET },
{ network: Network.CRONOS_TESTNET, apiKey: ApiKey.testnet },
{ network: Network.BASE },
{ network: Network.ZK_SYNC, url: 'https://mainnet.era.zksync.io' },
{ network: Network.ZK_SYNC_TESTNET, url: 'https://sepolia.era.zksync.dev' },
Expand Down
4 changes: 3 additions & 1 deletion src/e2e/rpc/other/tatum.rpc.solana.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Commitment, Encoding } from '../../../dto'
import { Network, Solana, TatumSDK } from '../../../service'
import { ApiKey } from '../../e2e.constant'
import { e2eUtil } from '../../e2e.util'

const getClient = async (testnet?: boolean): Promise<Solana> =>
Expand All @@ -8,6 +9,7 @@ const getClient = async (testnet?: boolean): Promise<Solana> =>
retryCount: 1,
retryDelay: 2000,
verbose: e2eUtil.isVerbose,
apiKey: testnet ? ApiKey.testnet : ApiKey.mainnet,
})

const blockNumber = 203046000
Expand Down Expand Up @@ -159,7 +161,7 @@ describe('Solana', () => {
})

describe('getFirstAvailableBlock', () => {
it('should return first available block', async () => {
it.skip('should return first available block', async () => {
const tatum = await getClient()
const { result } = await tatum.rpc.getFirstAvailableBlock()
await tatum.destroy()
Expand Down
43 changes: 28 additions & 15 deletions src/e2e/rpc/other/tatum.rpc.ton.spec.ts
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()
})
})
})
3 changes: 2 additions & 1 deletion src/e2e/rpc/utxo/utxo.rpc.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Network } from '../../../service'
import { ApiKeyV3 } from '../../e2e.constant'
import { UtxoE2eUtils, UtxoNetworkType } from './utxo.e2e.utils'

const utxoTestNetworks = [
Expand All @@ -11,7 +12,7 @@ const utxoTestNetworks = [
{
network: Network.ZCASH_TESTNET,
type: UtxoNetworkType.TEST,
apiKey: process.env.V3_API_KEY_TESTNET,
apiKey: ApiKeyV3.testnet,
skipEstimateSmartFee: true,
},
// { network: Network.ZCASH, type: UtxoNetworkType.MAIN, skipEstimateSmartFee: true },
Expand Down

0 comments on commit 87eaac2

Please sign in to comment.