fix lint of updated tests, fix wrong import

This commit is contained in:
einhornimmond 2026-03-03 11:35:35 +01:00
parent fd061e3de4
commit 22b73712b9
5 changed files with 21 additions and 14 deletions

View File

@ -1,10 +1,13 @@
import { describe, expect, it } from 'bun:test'
import { InteractionValidate, ValidateType_SINGLE } from 'gradido-blockchain-js'
import {
InMemoryBlockchainProvider,
InteractionValidate,
ValidateType_SINGLE,
} from 'gradido-blockchain-js'
import * as v from 'valibot'
import { transactionSchema } from '../../schemas/transaction.schema'
import { hieroIdSchema } from '../../schemas/typeGuard.schema'
import { RegisterAddressTransactionRole } from './RegisterAddressTransaction.role'
import { InMemoryBlockchainProvider } from 'gradido-blockchain-js'
const userUuid = '408780b2-59b3-402a-94be-56a4f4f4e8ec'
const communityId = '1e88a0f4-d4fc-4cae-a7e8-a88e613ce324'

View File

@ -1,4 +1,4 @@
import { Decimal } from 'decimal.js'
import { Decimal } from 'decimal.js-light'
import { and, asc, eq, gt, inArray, isNull, ne, or } from 'drizzle-orm'
import { alias } from 'drizzle-orm/mysql-core'
import {

View File

@ -99,13 +99,11 @@ describe('basic.schema', () => {
// create blockchain in native module
const communityId = 'fcd48487-6d31-4f4c-be9b-b3c8ca853912'
InMemoryBlockchainProvider.getInstance().getBlockchain(communityId)
const confirmedTransaction = v.parse(
confirmedTransactionSchema,
{
base64: 'CAcS4AEKZgpkCiCBZwMplGmI7fRR9MQkaR2Dz1qQQ5BCiC1btyJD71Ue9BJABODQ9sS70th9yHn8X3K+SNv2gsiIdX/V09baCvQCb+zo7nEQgCUXOEe/tN7YaRppwt6TDcXBPxkwnw4gfpCODhJ0ChkIAhIVRGFua2UgZnVlciBkZWluIFNlaW4hEgYIgMy5/wUaAzMuNTJKCiYKINsO1hJaFPAwq+0b/IMeCiGM+fq/zufs1YHAwOeI8BfHEJSYPRIgJE0o18xb6P6PsNjh0bkN52AzhggteTzoh09jV+blMq0aABoGCMLyuf8FIgMzLjcqIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMhUIAhoRCgkIqemnUhD+4wESBBj8sgc6Jgog2w7WEloU8DCr7Rv8gx4KIYz5+r/O5+zVgcDA54jwF8cQwIQ9OicKICRNKNfMW+j+j7DY4dG5DedgM4YILXk86IdPY1fm5TKtEOuUpQRAAg==',
communityId,
},
)
const confirmedTransaction = v.parse(confirmedTransactionSchema, {
base64:
'CAcS4AEKZgpkCiCBZwMplGmI7fRR9MQkaR2Dz1qQQ5BCiC1btyJD71Ue9BJABODQ9sS70th9yHn8X3K+SNv2gsiIdX/V09baCvQCb+zo7nEQgCUXOEe/tN7YaRppwt6TDcXBPxkwnw4gfpCODhJ0ChkIAhIVRGFua2UgZnVlciBkZWluIFNlaW4hEgYIgMy5/wUaAzMuNTJKCiYKINsO1hJaFPAwq+0b/IMeCiGM+fq/zufs1YHAwOeI8BfHEJSYPRIgJE0o18xb6P6PsNjh0bkN52AzhggteTzoh09jV+blMq0aABoGCMLyuf8FIgMzLjcqIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMhUIAhoRCgkIqemnUhD+4wESBBj8sgc6Jgog2w7WEloU8DCr7Rv8gx4KIYz5+r/O5+zVgcDA54jwF8cQwIQ9OicKICRNKNfMW+j+j7DY4dG5DedgM4YILXk86IdPY1fm5TKtEOuUpQRAAg==',
communityId,
})
expect(confirmedTransaction.getId()).toBe(7)
expect(confirmedTransaction.getConfirmedAt().getSeconds()).toBe(1609464130)
})

View File

@ -1,7 +1,7 @@
import { describe, expect, it } from 'bun:test'
import { v4 as uuidv4 } from 'uuid'
import * as v from 'valibot'
import { memoSchema, MEMO_MAX_CHARS, MEMO_MIN_CHARS, uuidv4Schema } from './typeGuard.schema'
import { MEMO_MAX_CHARS, MEMO_MIN_CHARS, memoSchema, uuidv4Schema } from './typeGuard.schema'
describe('typeGuard.schema', () => {
describe('Uuidv4', () => {
@ -26,7 +26,9 @@ describe('typeGuard.schema', () => {
})
it('to short', () => {
const memoValue = 'memo'
expect(() => v.parse(memoSchema, memoValue)).toThrow(new Error(`expect string length >= ${MEMO_MIN_CHARS}`))
expect(() => v.parse(memoSchema, memoValue)).toThrow(
new Error(`expect string length >= ${MEMO_MIN_CHARS}`),
)
})
it('to long', () => {
const memoValue = 's'.repeat(MEMO_MAX_CHARS + 1)

View File

@ -1,11 +1,15 @@
import { beforeAll, describe, expect, it, mock } from 'bun:test'
import { AccountId, Timestamp, TransactionId } from '@hashgraph/sdk'
import { GradidoTransaction, KeyPairEd25519, MemoryBlock } from 'gradido-blockchain-js'
import {
GradidoTransaction,
InMemoryBlockchainProvider,
KeyPairEd25519,
MemoryBlock,
} from 'gradido-blockchain-js'
import * as v from 'valibot'
import { KeyPairCacheManager } from '../cache/KeyPairCacheManager'
import { HieroId, hieroIdSchema } from '../schemas/typeGuard.schema'
import { appRoutes } from '.'
import { InMemoryBlockchainProvider } from 'gradido-blockchain-js'
const userUuid = '408780b2-59b3-402a-94be-56a4f4f4e8ec'