mirror of
https://github.com/codex-storage/cs-codex-dist-tests.git
synced 2025-02-11 11:37:12 +00:00
Logging of entire chain state as seen by rewarder bot
This commit is contained in:
parent
ba9e4b098f
commit
ccc6c815e4
@ -56,6 +56,7 @@ namespace CodexDiscordBotPlugin
|
||||
private RunningPod StartRewarderContainer(IStartupWorkflow workflow, RewarderBotStartupConfig config)
|
||||
{
|
||||
var startupConfig = new StartupConfig();
|
||||
startupConfig.NameOverride = config.Name;
|
||||
startupConfig.Add(config);
|
||||
return workflow.Start(1, new RewarderBotContainerRecipe(), startupConfig).WaitForOnline();
|
||||
}
|
||||
|
@ -27,8 +27,9 @@
|
||||
|
||||
public class RewarderBotStartupConfig
|
||||
{
|
||||
public RewarderBotStartupConfig(string discordBotHost, int discordBotPort, int intervalMinutes, DateTime historyStartUtc, DiscordBotGethInfo gethInfo, string? dataPath)
|
||||
public RewarderBotStartupConfig(string name, string discordBotHost, int discordBotPort, int intervalMinutes, DateTime historyStartUtc, DiscordBotGethInfo gethInfo, string? dataPath)
|
||||
{
|
||||
Name = name;
|
||||
DiscordBotHost = discordBotHost;
|
||||
DiscordBotPort = discordBotPort;
|
||||
IntervalMinutes = intervalMinutes;
|
||||
@ -37,6 +38,7 @@
|
||||
DataPath = dataPath;
|
||||
}
|
||||
|
||||
public string Name { get; }
|
||||
public string DiscordBotHost { get; }
|
||||
public int DiscordBotPort { get; }
|
||||
public int IntervalMinutes { get; }
|
||||
|
@ -121,6 +121,7 @@ namespace CodexTests.UtilityTests
|
||||
private void StartRewarderBot(DiscordBotGethInfo gethInfo, RunningContainer botContainer)
|
||||
{
|
||||
Ci.DeployRewarderBot(new RewarderBotStartupConfig(
|
||||
name: "rewarder-bot",
|
||||
discordBotHost: botContainer.GetInternalAddress(DiscordBotContainerRecipe.RewardsPort).Host,
|
||||
discordBotPort: botContainer.GetInternalAddress(DiscordBotContainerRecipe.RewardsPort).Port,
|
||||
intervalMinutes: Convert.ToInt32(Math.Round(rewarderInterval.TotalMinutes)),
|
||||
@ -145,7 +146,7 @@ namespace CodexTests.UtilityTests
|
||||
private RunningContainer StartDiscordBot(DiscordBotGethInfo gethInfo)
|
||||
{
|
||||
var bot = Ci.DeployCodexDiscordBot(new DiscordBotStartupConfig(
|
||||
name: "bot",
|
||||
name: "discord-bot",
|
||||
token: "aaa",
|
||||
serverName: "ThatBen's server",
|
||||
adminRoleName: "bottest-admins",
|
||||
|
@ -59,6 +59,17 @@ namespace TestNetRewarder
|
||||
public SlotFilledEventDTO[] SlotFilledEvents { get; }
|
||||
public SlotFreedEventDTO[] SlotFreedEvents { get; }
|
||||
|
||||
public string EntireString()
|
||||
{
|
||||
return
|
||||
$"NewRequests: {JsonConvert.SerializeObject(NewRequests)}" +
|
||||
$"FulfilledE: {JsonConvert.SerializeObject(RequestFulfilledEvents)}" +
|
||||
$"CancelledE: {JsonConvert.SerializeObject(RequestCancelledEvents)}" +
|
||||
$"FilledE: {JsonConvert.SerializeObject(SlotFilledEvents)}" +
|
||||
$"FreedE: {JsonConvert.SerializeObject(SlotFreedEvents)}" +
|
||||
$"Historic: {historicState.EntireString()}";
|
||||
}
|
||||
|
||||
public string[] GenerateOverview()
|
||||
{
|
||||
var entries = new List<StringBlockNumberPair>();
|
||||
|
@ -29,6 +29,11 @@ namespace TestNetRewarder
|
||||
r.State == RequestState.Failed
|
||||
);
|
||||
}
|
||||
|
||||
public string EntireString()
|
||||
{
|
||||
return JsonConvert.SerializeObject(StorageRequests);
|
||||
}
|
||||
}
|
||||
|
||||
public class StorageRequest
|
||||
|
@ -58,6 +58,8 @@ namespace TestNetRewarder
|
||||
|
||||
private async Task ProcessChainState(ChainState chainState)
|
||||
{
|
||||
log.Log($"Processing chain state: '{chainState.EntireString()}'");
|
||||
|
||||
var outgoingRewards = new List<RewardUsersCommand>();
|
||||
foreach (var reward in rewardRepo.Rewards)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user