From 495622d55d80ece4e44d3282e0bb873dfd1ac0de Mon Sep 17 00:00:00 2001 From: einhornimmond Date: Thu, 13 Nov 2025 08:32:42 +0100 Subject: [PATCH] update transaction seed account for structure chance in dlt-connector --- backend/src/apis/dltConnector/index.ts | 2 ++ backend/src/apis/dltConnector/model/AccountIdentifier.ts | 8 +++----- backend/src/apis/dltConnector/model/IdentifierSeed.ts | 9 --------- backend/src/apis/dltConnector/model/TransactionDraft.ts | 5 ++--- 4 files changed, 7 insertions(+), 17 deletions(-) delete mode 100644 backend/src/apis/dltConnector/model/IdentifierSeed.ts diff --git a/backend/src/apis/dltConnector/index.ts b/backend/src/apis/dltConnector/index.ts index bce319674..f81d928d1 100644 --- a/backend/src/apis/dltConnector/index.ts +++ b/backend/src/apis/dltConnector/index.ts @@ -36,8 +36,10 @@ async function checkDltConnectorResult(dltTransaction: DbDltTransaction, clientR logger.debug(e) if (e instanceof Error) { dltTransaction.error = e.message + logger.error('Error from dlt-connector', e) } else if (typeof e === 'string') { dltTransaction.error = e + logger.error('error from dlt-connector', e) } else { throw e } diff --git a/backend/src/apis/dltConnector/model/AccountIdentifier.ts b/backend/src/apis/dltConnector/model/AccountIdentifier.ts index ed1d61e51..3882e8584 100644 --- a/backend/src/apis/dltConnector/model/AccountIdentifier.ts +++ b/backend/src/apis/dltConnector/model/AccountIdentifier.ts @@ -1,15 +1,13 @@ import { CommunityAccountIdentifier } from './CommunityAccountIdentifier' -import { IdentifierSeed } from './IdentifierSeed' - export class AccountIdentifier { communityTopicId: string account?: CommunityAccountIdentifier - seed?: IdentifierSeed // used for deferred transfers + seed?: string // used for deferred transfers - constructor(communityTopicId: string, input: CommunityAccountIdentifier | IdentifierSeed) { + constructor(communityTopicId: string, input: CommunityAccountIdentifier | string) { if (input instanceof CommunityAccountIdentifier) { this.account = input - } else if (input instanceof IdentifierSeed) { + } else { this.seed = input } this.communityTopicId = communityTopicId diff --git a/backend/src/apis/dltConnector/model/IdentifierSeed.ts b/backend/src/apis/dltConnector/model/IdentifierSeed.ts deleted file mode 100644 index 7f7e2fe34..000000000 --- a/backend/src/apis/dltConnector/model/IdentifierSeed.ts +++ /dev/null @@ -1,9 +0,0 @@ -// https://www.npmjs.com/package/@apollo/protobufjs - -export class IdentifierSeed { - seed: string - - constructor(seed: string) { - this.seed = seed - } -} diff --git a/backend/src/apis/dltConnector/model/TransactionDraft.ts b/backend/src/apis/dltConnector/model/TransactionDraft.ts index 5c40da289..fdbce026f 100755 --- a/backend/src/apis/dltConnector/model/TransactionDraft.ts +++ b/backend/src/apis/dltConnector/model/TransactionDraft.ts @@ -12,7 +12,6 @@ import { import { CommunityAccountIdentifier } from './CommunityAccountIdentifier' import { getLogger } from 'log4js' import { LOG4JS_BASE_CATEGORY_NAME } from '@/config/const' -import { IdentifierSeed } from './IdentifierSeed' import { CODE_VALID_DAYS_DURATION } from '@/graphql/resolver/const/const' const logger = getLogger(`${LOG4JS_BASE_CATEGORY_NAME}.dltConnector.model.TransactionDraft`) @@ -94,7 +93,7 @@ export class TransactionDraft { } const draft = new TransactionDraft() draft.user = new AccountIdentifier(senderUserTopic, new CommunityAccountIdentifier(sendingUser.gradidoID)) - draft.linkedUser = new AccountIdentifier(senderUserTopic, new IdentifierSeed(transactionLink.code)) + draft.linkedUser = new AccountIdentifier(senderUserTopic, transactionLink.code) draft.type = TransactionType.GRADIDO_DEFERRED_TRANSFER draft.createdAt = transactionLink.createdAt.toISOString() draft.amount = transactionLink.amount.toString() @@ -119,7 +118,7 @@ export class TransactionDraft { throw new Error(`missing topicId for community ${recipientUser.community.id}`) } const draft = new TransactionDraft() - draft.user = new AccountIdentifier(senderUserTopic, new IdentifierSeed(transactionLink.code)) + draft.user = new AccountIdentifier(senderUserTopic, transactionLink.code) draft.linkedUser = new AccountIdentifier(recipientUserTopic, new CommunityAccountIdentifier(recipientUser.gradidoID)) draft.type = TransactionType.GRADIDO_REDEEM_DEFERRED_TRANSFER draft.createdAt = createdAt.toISOString()