-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #115 from Juneo-io/dev
v0.0.96
- Loading branch information
Showing
12 changed files
with
143 additions
and
180 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,101 +1,100 @@ | ||
import { MCNProvider, GenesisJUNEChain, GenesisNetwork } from '../../../src' | ||
import { GenesisJUNEChain } from '../../../src' | ||
import { PROVIDER } from '../constants' | ||
|
||
describe('InfoAPI', () => { | ||
const provider: MCNProvider = new MCNProvider(GenesisNetwork) | ||
|
||
describe('isBootstrapped', () => { | ||
test.each([{ chainID: GenesisJUNEChain.id }])('Valid: $chainID', async ({ chainID }) => { | ||
const result = await provider.info.isBootstrapped(chainID) | ||
const result = await PROVIDER.info.isBootstrapped(chainID) | ||
expect(result.isBootstrapped).toEqual(true) | ||
}) | ||
test.failing.each([{ chainID: 'WRONG_CHAIN_ID' }])('Invalid: $chainID', async ({ chainID }) => { | ||
await provider.info.isBootstrapped('WRONG_CHAIN_ID') | ||
await PROVIDER.info.isBootstrapped('WRONG_CHAIN_ID') | ||
}) | ||
}) | ||
|
||
describe('getBlockchainID', () => { | ||
test.each([{ alias: 'JUNE' }])('Valid: $alias', async ({ alias }) => { | ||
const result = await provider.info.getBlockchainID(alias) | ||
const result = await PROVIDER.info.getBlockchainID(alias) | ||
expect(result.blockchainID).toEqual(GenesisJUNEChain.id) | ||
}) | ||
test.failing.each([{ alias: 'WRONG_ALIAS' }])('Invalid: $alias', async ({ alias }) => { | ||
await provider.info.getBlockchainID('alias') | ||
await PROVIDER.info.getBlockchainID('alias') | ||
}) | ||
}) | ||
|
||
describe('getNetworkID', () => { | ||
test('Returns correct network id', async () => { | ||
const result = await provider.info.getNetworkID() | ||
expect(result.networkID).toEqual(provider.mcn.id.toString()) | ||
const result = await PROVIDER.info.getNetworkID() | ||
expect(result.networkID).toEqual(PROVIDER.mcn.id.toString()) | ||
}) | ||
}) | ||
|
||
describe('getNetworkName', () => { | ||
test('Returns correct network name', async () => { | ||
const result = await provider.info.getNetworkName() | ||
expect(result.networkName).toEqual(provider.mcn.hrp) | ||
const result = await PROVIDER.info.getNetworkName() | ||
expect(result.networkName).toEqual(PROVIDER.mcn.hrp) | ||
}) | ||
}) | ||
|
||
describe('getNodeID', () => { | ||
test('Returns node id', async () => { | ||
const result = await provider.info.getNodeID() | ||
const result = await PROVIDER.info.getNodeID() | ||
expect(result).toBeDefined() | ||
}) | ||
}) | ||
|
||
describe('getNodeIP', () => { | ||
test('Returns node ip', async () => { | ||
const result = await provider.info.getNodeIP() | ||
const result = await PROVIDER.info.getNodeIP() | ||
expect(result).toBeDefined() | ||
}) | ||
}) | ||
|
||
describe('getNodeVersion', () => { | ||
test('Returns node version', async () => { | ||
const result = await provider.info.getNodeVersion() | ||
const result = await PROVIDER.info.getNodeVersion() | ||
expect(result).toBeDefined() | ||
}) | ||
}) | ||
|
||
describe('getTxFee', () => { | ||
test('Returns fee config', async () => { | ||
const result = await provider.info.getTxFee() | ||
const result = await PROVIDER.info.getTxFee() | ||
expect(result).toBeDefined() | ||
}) | ||
test('Returns cached fee config', async () => { | ||
const result = await provider.info.getTxFee() | ||
const result = await PROVIDER.info.getTxFee() | ||
expect(result).toBeDefined() | ||
}) | ||
test('Returns updated fee config', async () => { | ||
const result = await provider.info.getTxFee(true) | ||
const result = await PROVIDER.info.getTxFee(true) | ||
expect(result).toBeDefined() | ||
}) | ||
}) | ||
|
||
describe('getVMs', () => { | ||
test('Returns installed VMs', async () => { | ||
const result = await provider.info.getVMs() | ||
const result = await PROVIDER.info.getVMs() | ||
expect(result).toBeDefined() | ||
}) | ||
}) | ||
|
||
describe('peers', () => { | ||
test('Returns list of peers', async () => { | ||
const result = await provider.info.peers() | ||
const result = await PROVIDER.info.peers() | ||
expect(result).toBeDefined() | ||
}) | ||
test.failing.each([ | ||
{ nodeIDs: ['WRONG_NODE_ID', 'NodeID-P1ESFUf8tutmR8hszZUWsXAJEKARZ5SPw'] }, | ||
{ nodeIDs: ['NodeID-P1ESFUf8tutmR8hszZUWsXAJEKARZ5SPa'] } | ||
])('Invalid: $nodeIDs', async ({ nodeIDs }) => { | ||
await provider.info.peers(nodeIDs) | ||
await PROVIDER.info.peers(nodeIDs) | ||
}) | ||
}) | ||
|
||
describe('uptime', () => { | ||
test.failing.each([{ supernetID: 'WRONG_SUPERNET_ID' }])('Invalid: $supernetID', async ({ supernetID }) => { | ||
await provider.info.uptime(supernetID) | ||
await PROVIDER.info.uptime(supernetID) | ||
}) | ||
}) | ||
}) |
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
Oops, something went wrong.