diff --git a/database/src/factories/transaction.factory.ts b/database/src/factories/transaction.factory.ts index 87af75baf..44a6150f2 100644 --- a/database/src/factories/transaction.factory.ts +++ b/database/src/factories/transaction.factory.ts @@ -10,15 +10,10 @@ define(Transaction, (faker: typeof Faker, context?: TransactionContext) => { } const transaction = new Transaction() - transaction.transactionTypeId = context.transactionTypeId // || 2 + transaction.typeId = context.typeId // || 2 transaction.userId = context.userId transaction.amount = context.amount - transaction.txHash = context.txHash || randomBytes(48) transaction.memo = context.memo - transaction.received = context.received || new Date() - transaction.signature = context.signature || randomBytes(64) - transaction.pubkey = context.pubkey || randomBytes(32) - transaction.creationIdentHash = context.creationIdentHash || randomBytes(32) transaction.creationDate = context.creationDate || new Date() // transaction.sendReceiverPublicKey = context.sendReceiverPublicKey || null transaction.linkedUserId = context.sendReceiverUserId || null diff --git a/database/src/interface/TransactionContext.ts b/database/src/interface/TransactionContext.ts index d424a5731..9da737974 100644 --- a/database/src/interface/TransactionContext.ts +++ b/database/src/interface/TransactionContext.ts @@ -1,21 +1,13 @@ -import { Transaction } from '../../entity/Transaction' import { User } from '../../entity/User' export interface TransactionContext { - transactionId: number - transactionTypeId: number + typeId: number userId: number balance: BigInt balanceDate: Date amount: BigInt - txHash?: Buffer memo: string - received?: Date - signature?: Buffer - pubkey?: Buffer - creationIdentHash?: Buffer creationDate?: Date - sendReceiverPublicKey?: Buffer sendReceiverUserId?: number sendSenderFinalBalance?: BigInt } @@ -26,13 +18,3 @@ export interface BalanceContext { amount?: number user?: User } - -export interface TransactionSendCoinContext { - senderPublic?: Buffer - userId?: number - recipiantPublic?: Buffer - recipiantUserId?: number - amount?: number - senderFinalBalance?: number - transaction?: Transaction -} diff --git a/database/src/seeds/helpers/user-helpers.ts b/database/src/seeds/helpers/user-helpers.ts index e4c0314b7..c00b5ad0d 100644 --- a/database/src/seeds/helpers/user-helpers.ts +++ b/database/src/seeds/helpers/user-helpers.ts @@ -69,17 +69,12 @@ const createTransactionContext = ( memo: string, ): TransactionContext => { return { - transactionId: randomInt(999999), - transactionTypeId: type, + typeId: type, userId: user.id, amount: BigInt(context.amount || 100000), balance: BigInt(context.amount || 100000), balanceDate: new Date(context.recordDate || Date.now()), - txHash: context.creationTxHash, memo, - received: context.recordDate, creationDate: context.creationDate, - signature: context.signature, - pubkey: context.pubKey, } }