Adds short-format UTC to block header for each chain-events channel entry.

This commit is contained in:
Ben 2024-09-30 11:09:44 +02:00
parent 200de1d7f7
commit 6a8c74e02a
No known key found for this signature in database
GPG Key ID: 0F16E812E736C24B
2 changed files with 8 additions and 2 deletions

View File

@ -31,7 +31,7 @@ namespace BiblioTech.Rewards
{
var @event = ApplyReplacements(users, e);
await eventsChannel.SendMessageAsync(@event);
await Task.Delay(3000);
await Task.Delay(1000);
}
}
});

View File

@ -1,6 +1,7 @@
using CodexContractsPlugin;
using CodexContractsPlugin.ChainMonitor;
using GethPlugin;
using System.Globalization;
using System.Numerics;
using Utils;
@ -76,7 +77,7 @@ namespace TestNetRewarder
private void AddRequestBlock(RequestEvent requestEvent, string eventName, params string[] content)
{
var blockNumber = $"[{requestEvent.Block.BlockNumber}]";
var blockNumber = $"[{requestEvent.Block.BlockNumber} {FormatDateTime(requestEvent.Block.Utc)}]";
var title = $"{blockNumber} **{eventName}** `{requestEvent.Request.Request.Id}`";
AddBlock(title, content);
}
@ -107,6 +108,11 @@ namespace TestNetRewarder
) + nl + nl;
}
private string FormatDateTime(DateTime utc)
{
return utc.ToString("yyyy-MM-dd HH:mm:ss UTC", CultureInfo.InvariantCulture);
}
private string BigIntToDuration(BigInteger big)
{
var span = TimeSpan.FromSeconds((int)big);