From acc3cb5a5c65df5b0b2ca3bcbebf5b7d2b8f6493 Mon Sep 17 00:00:00 2001 From: Alessandro Manfredi Date: Wed, 1 May 2024 16:21:09 +0200 Subject: [PATCH] refactor(relayer): formats and changes comment --- packages/relayer/src/index.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/packages/relayer/src/index.ts b/packages/relayer/src/index.ts index 042d2688..f4925ec2 100644 --- a/packages/relayer/src/index.ts +++ b/packages/relayer/src/index.ts @@ -66,10 +66,13 @@ const batcher = new Batcher({ logger, minBatchSize: Number(process.env.MIN_BATCH_SIZE as string), onGetValues: () => { - return db.collection("relayedMessages").find({ - status: "dispatched", - address: process.env.YAHO_ADDRESS as `0x${string}`, - }).toArray() + return db + .collection("relayedMessages") + .find({ + status: "dispatched", + address: process.env.YAHO_ADDRESS as `0x${string}`, + }) + .toArray() }, onBatch: async (_batch: Document[]) => { const serializedMessages = _batch.map((_val: any) => @@ -87,7 +90,7 @@ const batcher = new Batcher({ args: [serializedMessages], }) const transactionHash = await client.writeContract(request) - logger.child({ service: "Relayer" }).info(`Messages relayed: ${transactionHash}`) + logger.child({ service: "Relayer" }).info(`${serializedMessages.length} messages relayed: ${transactionHash}`) return transactionHash }, onResult: (_result: any, _values: Document[]) => {