Skip to content

Commit 6a8c74e

Browse files
committed
Adds short-format UTC to block header for each chain-events channel entry.
1 parent 200de1d commit 6a8c74e

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

Tools/BiblioTech/Rewards/ChainEventsSender.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ await Task.Run(async () =>
3131
{
3232
var @event = ApplyReplacements(users, e);
3333
await eventsChannel.SendMessageAsync(@event);
34-
await Task.Delay(3000);
34+
await Task.Delay(1000);
3535
}
3636
}
3737
});

Tools/TestNetRewarder/EventsFormatter.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using CodexContractsPlugin;
22
using CodexContractsPlugin.ChainMonitor;
33
using GethPlugin;
4+
using System.Globalization;
45
using System.Numerics;
56
using Utils;
67

@@ -76,7 +77,7 @@ public void OnSlotFreed(RequestEvent requestEvent, BigInteger slotIndex)
7677

7778
private void AddRequestBlock(RequestEvent requestEvent, string eventName, params string[] content)
7879
{
79-
var blockNumber = $"[{requestEvent.Block.BlockNumber}]";
80+
var blockNumber = $"[{requestEvent.Block.BlockNumber} {FormatDateTime(requestEvent.Block.Utc)}]";
8081
var title = $"{blockNumber} **{eventName}** `{requestEvent.Request.Request.Id}`";
8182
AddBlock(title, content);
8283
}
@@ -107,6 +108,11 @@ private string FormatBlock(string title, params string[] content)
107108
) + nl + nl;
108109
}
109110

111+
private string FormatDateTime(DateTime utc)
112+
{
113+
return utc.ToString("yyyy-MM-dd HH:mm:ss UTC", CultureInfo.InvariantCulture);
114+
}
115+
110116
private string BigIntToDuration(BigInteger big)
111117
{
112118
var span = TimeSpan.FromSeconds((int)big);

0 commit comments

Comments
 (0)