changes for review suggestions

This commit is contained in:
Einhornimmond 2023-12-30 09:02:58 +01:00
parent 4c178ec92a
commit 6b64f2036c
4 changed files with 5 additions and 1 deletions

1
backend/.gitignore vendored
View File

@ -4,5 +4,6 @@
/build/
package-json.lock
coverage
log.txt
# emacs
*~

View File

@ -126,12 +126,14 @@ export class TransactionBody extends Message<TransactionBody> {
public getRecipientPublicKey(): Buffer | undefined {
if (this.transfer) {
// this.transfer.recipient contains the publicKey of the recipient
return this.transfer.recipient
}
if (this.creation) {
return this.creation.recipient.pubkey
}
if (this.deferredTransfer) {
// this.deferredTransfer.transfer.recipient contains the publicKey of the recipient
return this.deferredTransfer.transfer.recipient
}
return undefined

View File

@ -59,7 +59,7 @@ export class Connection {
public async init(): Promise<void> {
await this.connection.initialize()
try {
await Connection.getInstance()
Connection.getInstance()
} catch (error) {
// try and catch for logging
logger.fatal(`Couldn't open connection to database!`)

View File

@ -10,6 +10,7 @@ import {
import { Decimal } from 'decimal.js-light'
import { DecimalTransformer } from '../../src/typeorm/DecimalTransformer'
// the relation in future account don't match which this any longer, so we can only link with the local account here
import { Account } from './Account'
// TransactionRecipe was removed in newer migrations, so only the version from this folder can be linked
import { TransactionRecipe } from '../0001-init_db/TransactionRecipe'