Skip to content

Commit

Permalink
Review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Nikitin committed Aug 9, 2023
1 parent 1caec01 commit 34ad0c2
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
6 changes: 0 additions & 6 deletions tests/constants.ts

This file was deleted.

9 changes: 9 additions & 0 deletions tests/testutils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@ export const image_content = 'iVBORw0KGgoAAAANSUhEUgAAAQAAAAEAAQMAAABmvDolAAAAA1

export const default_content = '<p>Test file content</p>'

// 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<T>(array: T[], values: T[]): boolean {
return values.every(value => array.includes(value))
}
Expand Down
6 changes: 3 additions & 3 deletions tests/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 34ad0c2

Please sign in to comment.