Skip to content

Commit

Permalink
fix: add transaction error reason transformer (#186)
Browse files Browse the repository at this point in the history
# What ❔

Add transaction error reason transformer.

## Why ❔

To unsure error and reason are transformed correctly.

## Checklist

<!-- Check your PR fulfills the following items. -->
<!-- For draft PRs check the boxes as you complete them. -->

- [X] PR title corresponds to the body of PR (we generate changelog
entries from PRs).
  • Loading branch information
vasyl-ivanchuk authored Feb 24, 2024
1 parent 7347c9b commit 18925c4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/worker/src/entities/transaction.entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"])
Expand Down Expand Up @@ -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;
}

0 comments on commit 18925c4

Please sign in to comment.