Commit 287d317d authored by Maurelian's avatar Maurelian

feat(cmon): fix time string formatting bug

parent 62c7f3b0
---
'@eth-optimism/chain-mon': patch
---
Fixed an issue with logging the wrong timestamp.
......@@ -191,16 +191,14 @@ export class WithdrawalMonitor extends BaseServiceV2<Options, Metrics, State> {
await this.state.messenger.contracts.l2.BedrockMessagePasser.sentMessages(
proofEvent.args.withdrawalHash
)
const provenAt = `${
(dateformat(
new Date(
(await this.options.l1RpcProvider.getBlock(proofEvent.blockHash))
.timestamp * 1000
)
),
const block = await proofEvent.getBlock()
const now = new Date(block.timestamp * 1000)
const dateString = dateformat(
now,
'mmmm dS, yyyy, h:MM:ss TT',
true)
} UTC`
true // use UTC time
)
const provenAt = `${dateString} UTC`
if (exists) {
this.metrics.withdrawalsValidated.inc()
this.logger.info(`valid withdrawal`, {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment