diff --git a/backend/.env.dist b/backend/.env.dist index 0860b9c94..f9fcb035f 100644 --- a/backend/.env.dist +++ b/backend/.env.dist @@ -22,7 +22,7 @@ KLICKTIPP_APIKEY_DE=SomeFakeKeyDE KLICKTIPP_APIKEY_EN=SomeFakeKeyEN # DltConnector -DLT_CONNECTOR=true +DLT_ACTIVE=false DLT_CONNECTOR_URL=http://localhost:6010 # Community diff --git a/backend/.env.org b/backend/.env.org index 2267fdc50..d352693a6 100644 --- a/backend/.env.org +++ b/backend/.env.org @@ -22,7 +22,7 @@ KLICKTIPP_APIKEY_DE=SomeFakeKeyDE KLICKTIPP_APIKEY_EN=SomeFakeKeyEN # DltConnector -DLT_CONNECTOR=true +DLT_ACTIVE=true DLT_CONNECTOR_URL=http://localhost:6010 # Community diff --git a/backend/.env.template b/backend/.env.template index 5212d1e1b..98090546d 100644 --- a/backend/.env.template +++ b/backend/.env.template @@ -24,7 +24,7 @@ KLICKTIPP_APIKEY_DE=$KLICKTIPP_APIKEY_DE KLICKTIPP_APIKEY_EN=$KLICKTIPP_APIKEY_EN # DltConnector -DLT_CONNECTOR=$DLT_CONNECTOR +DLT_ACTIVE=$DLT_ACTIVE DLT_CONNECTOR_PORT=$DLT_CONNECTOR_PORT # Community diff --git a/backend/src/apis/dltConnector/DltConnectorClient.test.ts b/backend/src/apis/dltConnector/DltConnectorClient.test.ts index e3673791b..55acb6e04 100644 --- a/backend/src/apis/dltConnector/DltConnectorClient.test.ts +++ b/backend/src/apis/dltConnector/DltConnectorClient.test.ts @@ -5,17 +5,17 @@ import { DltConnectorClient } from './DltConnectorClient' describe('undefined DltConnectorClient', () => { it('invalid url', () => { CONFIG.DLT_CONNECTOR_URL = '' - CONFIG.DLT_CONNECTOR = true + CONFIG.DLT_ACTIVE = true const result = DltConnectorClient.getInstance() expect(result).toBeUndefined() CONFIG.DLT_CONNECTOR_URL = 'http://dlt-connector:6010' }) - it('DLT_CONNECTOR is false', () => { - CONFIG.DLT_CONNECTOR = false + it('DLT_ACTIVE is false', () => { + CONFIG.DLT_ACTIVE = false const result = DltConnectorClient.getInstance() expect(result).toBeUndefined() - CONFIG.DLT_CONNECTOR = true + CONFIG.DLT_ACTIVE = true }) }) diff --git a/backend/src/apis/dltConnector/DltConnectorClient.ts b/backend/src/apis/dltConnector/DltConnectorClient.ts index a5e162ba0..2a1ced85d 100644 --- a/backend/src/apis/dltConnector/DltConnectorClient.ts +++ b/backend/src/apis/dltConnector/DltConnectorClient.ts @@ -31,7 +31,7 @@ export class DltConnectorClient { * just one instance of each subclass around. */ public static getInstance(): DltConnectorClient | undefined { - if (!CONFIG.DLT_CONNECTOR || !CONFIG.DLT_CONNECTOR_URL) { + if (!CONFIG.DLT_ACTIVE || !CONFIG.DLT_CONNECTOR_URL) { logger.info(`dlt-connector are disabled via config...`) return } diff --git a/backend/src/apis/dltConnector/__mocks__/DltConnectorClient.ts b/backend/src/apis/dltConnector/__mocks__/DltConnectorClient.ts index 81a7c5398..5a2c96d79 100644 --- a/backend/src/apis/dltConnector/__mocks__/DltConnectorClient.ts +++ b/backend/src/apis/dltConnector/__mocks__/DltConnectorClient.ts @@ -30,7 +30,7 @@ export class DltConnectorClient { * just one instance of each subclass around. */ public static getInstance(): DltConnectorClient | undefined { - if (!CONFIG.DLT_CONNECTOR || !CONFIG.DLT_CONNECTOR_URL) { + if (!CONFIG.DLT_ACTIVE || !CONFIG.DLT_CONNECTOR_URL) { logger.info(`dlt-connector are disabled via config...`) return } diff --git a/backend/src/apis/dltConnector/index.ts b/backend/src/apis/dltConnector/index.ts index bce319674..dd192b82c 100644 --- a/backend/src/apis/dltConnector/index.ts +++ b/backend/src/apis/dltConnector/index.ts @@ -64,7 +64,7 @@ async function executeDltTransaction(draft: TransactionDraft | null, typeId: Dlt * and update dltTransactionId of transaction in db with hiero transaction id */ export async function registerAddressTransaction(user: DbUser, community: DbCommunity): Promise { - if (!CONFIG.DLT_CONNECTOR) { + if (!CONFIG.DLT_ACTIVE) { return Promise.resolve(null) } if (!user.id) { @@ -88,7 +88,7 @@ export async function contributionTransaction( signingUser: DbUser, createdAt: Date, ): Promise { - if (!CONFIG.DLT_CONNECTOR) { + if (!CONFIG.DLT_ACTIVE) { return Promise.resolve(null) } const homeCommunity = await getHomeCommunity() @@ -107,7 +107,7 @@ export async function transferTransaction( memo: string, createdAt: Date ): Promise { - if (!CONFIG.DLT_CONNECTOR) { + if (!CONFIG.DLT_ACTIVE) { return Promise.resolve(null) } // load community if not already loaded, maybe they are remote communities @@ -125,7 +125,7 @@ export async function transferTransaction( export async function deferredTransferTransaction(senderUser: DbUser, transactionLink: DbTransactionLink) : Promise { - if (!CONFIG.DLT_CONNECTOR) { + if (!CONFIG.DLT_ACTIVE) { return Promise.resolve(null) } // load community if not already loaded @@ -138,7 +138,7 @@ export async function deferredTransferTransaction(senderUser: DbUser, transactio export async function redeemDeferredTransferTransaction(transactionLink: DbTransactionLink, amount: string, createdAt: Date, recipientUser: DbUser) : Promise { - if (!CONFIG.DLT_CONNECTOR) { + if (!CONFIG.DLT_ACTIVE) { return Promise.resolve(null) } // load user and communities if not already loaded diff --git a/backend/src/graphql/resolver/TransactionLinkResolver.test.ts b/backend/src/graphql/resolver/TransactionLinkResolver.test.ts index b6abcb0b2..18eb9dde6 100644 --- a/backend/src/graphql/resolver/TransactionLinkResolver.test.ts +++ b/backend/src/graphql/resolver/TransactionLinkResolver.test.ts @@ -43,7 +43,7 @@ const logErrorLogger = getLogger(`${LOG4JS_BASE_CATEGORY_NAME}.server.LogError`) jest.mock('@/password/EncryptorUtils') -CONFIG.DLT_CONNECTOR = false +CONFIG.DLT_ACTIVE = false // mock semaphore to allow use fake timers jest.mock('database/src/util/TRANSACTIONS_LOCK') diff --git a/backend/src/graphql/resolver/TransactionResolver.test.ts b/backend/src/graphql/resolver/TransactionResolver.test.ts index a134ca84b..44c10deb9 100644 --- a/backend/src/graphql/resolver/TransactionResolver.test.ts +++ b/backend/src/graphql/resolver/TransactionResolver.test.ts @@ -38,7 +38,7 @@ import { CONFIG } from '@/config' jest.mock('@/password/EncryptorUtils') const logger = getLogger(`${LOG4JS_BASE_CATEGORY_NAME}.server.LogError`) -CONFIG.DLT_CONNECTOR = false +CONFIG.DLT_ACTIVE = false CONFIG.EMAIL = false let mutate: ApolloServerTestClient['mutate'] diff --git a/backend/src/graphql/resolver/UserResolver.test.ts b/backend/src/graphql/resolver/UserResolver.test.ts index cee570c94..aaa7bcca9 100644 --- a/backend/src/graphql/resolver/UserResolver.test.ts +++ b/backend/src/graphql/resolver/UserResolver.test.ts @@ -117,7 +117,7 @@ beforeAll(async () => { query = testEnv.query con = testEnv.con CONFIG.HUMHUB_ACTIVE = false - CONFIG.DLT_CONNECTOR = false + CONFIG.DLT_ACTIVE = false await cleanDB() }) diff --git a/backend/src/graphql/resolver/semaphore.test.ts b/backend/src/graphql/resolver/semaphore.test.ts index d0bf08b7c..dce6354ef 100644 --- a/backend/src/graphql/resolver/semaphore.test.ts +++ b/backend/src/graphql/resolver/semaphore.test.ts @@ -26,7 +26,7 @@ import { TRANSACTIONS_LOCK } from 'database' jest.mock('@/password/EncryptorUtils') -CONFIG.DLT_CONNECTOR = false +CONFIG.DLT_ACTIVE = false CONFIG.EMAIL = false let mutate: ApolloServerTestClient['mutate']