mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
fixed seeds
This commit is contained in:
parent
5cb67cf588
commit
0c5466f650
@ -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
|
||||
|
||||
@ -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
|
||||
}
|
||||
|
||||
@ -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,
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user