From 34ad0c27e2200b0e3770ad3732c4f09f00c34b48 Mon Sep 17 00:00:00 2001 From: Andrew Nikitin Date: Wed, 9 Aug 2023 19:16:41 +0400 Subject: [PATCH] Review comments --- tests/constants.ts | 6 ------ tests/testutils.test.ts | 9 +++++++++ tests/utils.test.ts | 6 +++--- 3 files changed, 12 insertions(+), 9 deletions(-) delete mode 100644 tests/constants.ts diff --git a/tests/constants.ts b/tests/constants.ts deleted file mode 100644 index 56f6c9e2..00000000 --- a/tests/constants.ts +++ /dev/null @@ -1,6 +0,0 @@ -// They are connected -export const PUBKEY_HEX = "04adf6cad45e58a7e1908bebefcc358de229c108fb1170566f83be5ce028eb6b1997711067ffcb445532667ed4a4efc2b334c16421edb52ec5e0324a1c0e570663" -export const BECH32_ACCOUNT = "cheqd1ehcg0jarxkyxtkzrwcxayedxrskwyftxj4exm9" -// Testnet RPC nad faucet address -export const FAUCET_ADDRESS = "cheqd1rnr5jrt4exl0samwj0yegv99jeskl0hsxmcz96" -export const TESTNET_RPC = "https://rpc.cheqd.network:443" \ No newline at end of file diff --git a/tests/testutils.test.ts b/tests/testutils.test.ts index 16f1efc6..bb7dae70 100644 --- a/tests/testutils.test.ts +++ b/tests/testutils.test.ts @@ -19,6 +19,15 @@ export const image_content = 'iVBORw0KGgoAAAANSUhEUgAAAQAAAAEAAQMAAABmvDolAAAAA1 export const default_content = '

Test file content

' +// They are connected +export const pubkey_hex = "04adf6cad45e58a7e1908bebefcc358de229c108fb1170566f83be5ce028eb6b1997711067ffcb445532667ed4a4efc2b334c16421edb52ec5e0324a1c0e570663" + +export const bech32_account = "cheqd1ehcg0jarxkyxtkzrwcxayedxrskwyftxj4exm9" +// Testnet RPC and faucet address +export const faucet_address = "cheqd1rnr5jrt4exl0samwj0yegv99jeskl0hsxmcz96" + +export const testnet_rpc = "https://rpc.cheqd.network:443" + export function containsAll(array: T[], values: T[]): boolean { return values.every(value => array.includes(value)) } diff --git a/tests/utils.test.ts b/tests/utils.test.ts index 7c4c421f..575484f2 100644 --- a/tests/utils.test.ts +++ b/tests/utils.test.ts @@ -15,7 +15,7 @@ import { MethodSpecificIdAlgo, VerificationMethods } from '../src/types' -import { FAUCET_ADDRESS, PUBKEY_HEX, TESTNET_RPC } from './constants' +import { faucet_address, pubkey_hex, testnet_rpc } from './testutils.test' describe('createSignInputsFromImportableEd25519Key', () => { it('should create a sign input from an importable ed25519 key 2020', async () => { @@ -82,12 +82,12 @@ describe('createSignInputsFromImportableEd25519Key', () => { // We know, that such point could be transformed to a cheqd account cheqd1ehcg0jarxkyxtkzrwcxayedxrskwyftxj4exm9 const expectedAddress = "cheqd1ehcg0jarxkyxtkzrwcxayedxrskwyftxj4exm9" - expect(expectedAddress).toEqual(getCosmosAccount(PUBKEY_HEX)) + expect(expectedAddress).toEqual(getCosmosAccount(pubkey_hex)) }) it('should return not empty account balance', async () => { - const balances = await checkBalance(FAUCET_ADDRESS, TESTNET_RPC) + const balances = await checkBalance(faucet_address, testnet_rpc) expect(balances.length).toBeGreaterThan(0) expect(balances[0].denom).toEqual("ncheq") expect(+balances[0].amount).toBeGreaterThan(0)