From 18925c442950e5f0338a1f37584adf5cf7a13253 Mon Sep 17 00:00:00 2001 From: Vasyl Ivanchuk Date: Sat, 24 Feb 2024 13:04:51 +0200 Subject: [PATCH] fix: add transaction error reason transformer (#186) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # What ❔ Add transaction error reason transformer. ## Why ❔ To unsure error and reason are transformed correctly. ## Checklist - [X] PR title corresponds to the body of PR (we generate changelog entries from PRs). --- packages/worker/src/entities/transaction.entity.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/worker/src/entities/transaction.entity.ts b/packages/worker/src/entities/transaction.entity.ts index 75d1090398..b7fe17d1fa 100644 --- a/packages/worker/src/entities/transaction.entity.ts +++ b/packages/worker/src/entities/transaction.entity.ts @@ -4,6 +4,7 @@ import { hexTransformer } from "../transformers/hex.transformer"; import { Batch } from "./batch.entity"; import { Block } from "./block.entity"; import { CountableEntity } from "./countable.entity"; +import { stringTransformer } from "../transformers/string.transformer"; @Entity({ name: "transactions" }) @Index(["receivedAt", "transactionIndex"]) @@ -89,9 +90,9 @@ export class Transaction extends CountableEntity { @Column({ type: "int", default: 1 }) public readonly receiptStatus: number; - @Column({ nullable: true }) + @Column({ nullable: true, transformer: stringTransformer }) public readonly error?: string; - @Column({ nullable: true }) + @Column({ nullable: true, transformer: stringTransformer }) public readonly revertReason?: string; }