Skip to content

Commit

Permalink
refactor(relayer): formats and changes comment
Browse files Browse the repository at this point in the history
  • Loading branch information
allemanfredi committed May 1, 2024
1 parent 3003a77 commit acc3cb5
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions packages/relayer/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) =>
Expand All @@ -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[]) => {
Expand Down

0 comments on commit acc3cb5

Please sign in to comment.