From 354a549200228d7ea61880967a55641f7cb2779b Mon Sep 17 00:00:00 2001 From: supaiku Date: Thu, 21 Feb 2019 15:43:05 +0100 Subject: [PATCH] fix: elastic search transaction index --- packages/core-elasticsearch/src/indices/transactions.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/core-elasticsearch/src/indices/transactions.ts b/packages/core-elasticsearch/src/indices/transactions.ts index e2eec0718c..144fdfde9a 100644 --- a/packages/core-elasticsearch/src/indices/transactions.ts +++ b/packages/core-elasticsearch/src/indices/transactions.ts @@ -1,4 +1,4 @@ -import { models } from "@arkecosystem/crypto"; +import { Transaction } from "@arkecosystem/crypto"; import { client } from "../client"; import { storage } from "../storage"; import { first, last } from "../utils"; @@ -22,10 +22,10 @@ export class Transactions extends Index { if (rows.length) { rows = rows.map(row => { - const transaction: any = new models.Transaction(row.serialized.toString("hex")); - transaction.blockId = row.blockId; + const { data } = Transaction.fromBytes(row.serialized); + data.blockId = row.blockId; - return transaction; + return data; }); const timestamps = rows.map(row => row.data.timestamp);