fixed seeds

This commit is contained in:
Ulf Gebhardt 2022-02-24 00:32:45 +01:00
parent 5cb67cf588
commit 0c5466f650
Signed by: ulfgebhardt
GPG Key ID: DA6B843E748679C9
3 changed files with 3 additions and 31 deletions

View File

@ -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

View File

@ -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
}

View File

@ -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,
}
}