From 87bda475df3d773f1e2fe3d9c5fae49700b257f3 Mon Sep 17 00:00:00 2001 From: Ben Date: Wed, 21 Aug 2024 13:59:54 +0200 Subject: [PATCH] Set up contract-failed event. --- Framework/Utils/RollingAverage.cs | 21 ++++++ .../ChainMonitor/ChainEvents.cs | 5 ++ .../ChainMonitor/ChainState.cs | 12 +++- .../ChainStateChangeHandlerMux.cs | 55 ++++++++++++++ .../DoNothingChainEventHandler.cs | 4 ++ .../CodexContractsEvents.cs | 12 ++++ .../Marketplace/Customizations.cs | 6 ++ Tests/FrameworkTests/Utils/TimeTests.cs | 11 +++ Tools/MarketInsights/AppState.cs | 13 ++++ Tools/MarketInsights/AverageHistory.cs | 71 +++++++++++++++++++ Tools/MarketInsights/Configuration.cs | 37 ++++++++++ .../Controllers/MarketController.cs | 9 ++- Tools/MarketInsights/MarketInsights.csproj | 5 ++ Tools/MarketInsights/Model.cs | 5 ++ Tools/MarketInsights/Program.cs | 17 ++++- Tools/MarketInsights/Updater.cs | 35 +++++++++ Tools/TestNetRewarder/ChainChangeMux.cs | 46 ------------ Tools/TestNetRewarder/EventsFormatter.cs | 5 ++ Tools/TestNetRewarder/MarketTracker.cs | 5 ++ Tools/TestNetRewarder/Processor.cs | 2 +- Tools/TestNetRewarder/RewardCheck.cs | 4 ++ Tools/TestNetRewarder/RewardChecker.cs | 2 +- 22 files changed, 327 insertions(+), 55 deletions(-) create mode 100644 Framework/Utils/RollingAverage.cs create mode 100644 ProjectPlugins/CodexContractsPlugin/ChainMonitor/ChainStateChangeHandlerMux.cs create mode 100644 Tools/MarketInsights/AppState.cs create mode 100644 Tools/MarketInsights/AverageHistory.cs create mode 100644 Tools/MarketInsights/Configuration.cs create mode 100644 Tools/MarketInsights/Updater.cs delete mode 100644 Tools/TestNetRewarder/ChainChangeMux.cs diff --git a/Framework/Utils/RollingAverage.cs b/Framework/Utils/RollingAverage.cs new file mode 100644 index 0000000..5674684 --- /dev/null +++ b/Framework/Utils/RollingAverage.cs @@ -0,0 +1,21 @@ +namespace Utils +{ + public static class RollingAverage + { + /// Value of average before new value is added. + /// Number of values in average after new value is added. + /// New value to be added. + /// New average value. + /// newNumberOfValues must be 1 or greater. + public static float GetNewAverage(float currentAverage, int newNumberOfValues, float newValue) + { + if (newNumberOfValues < 1) throw new Exception("Should be at least 1 value."); + + float n = newNumberOfValues; + var originalValue = currentAverage; + var originalValueWeight = ((n - 1.0f) / n); + var newValueWeight = (1.0f / n); + return (originalValue * originalValueWeight) + (newValue * newValueWeight); + } + } +} diff --git a/ProjectPlugins/CodexContractsPlugin/ChainMonitor/ChainEvents.cs b/ProjectPlugins/CodexContractsPlugin/ChainMonitor/ChainEvents.cs index 25d0851..aef3932 100644 --- a/ProjectPlugins/CodexContractsPlugin/ChainMonitor/ChainEvents.cs +++ b/ProjectPlugins/CodexContractsPlugin/ChainMonitor/ChainEvents.cs @@ -10,6 +10,7 @@ namespace CodexContractsPlugin.ChainMonitor Request[] requests, RequestFulfilledEventDTO[] fulfilled, RequestCancelledEventDTO[] cancelled, + RequestFailedEventDTO[] failed, SlotFilledEventDTO[] slotFilled, SlotFreedEventDTO[] slotFreed ) @@ -18,6 +19,7 @@ namespace CodexContractsPlugin.ChainMonitor Requests = requests; Fulfilled = fulfilled; Cancelled = cancelled; + Failed = failed; SlotFilled = slotFilled; SlotFreed = slotFreed; } @@ -26,6 +28,7 @@ namespace CodexContractsPlugin.ChainMonitor public Request[] Requests { get; } public RequestFulfilledEventDTO[] Fulfilled { get; } public RequestCancelledEventDTO[] Cancelled { get; } + public RequestFailedEventDTO[] Failed { get; } public SlotFilledEventDTO[] SlotFilled { get; } public SlotFreedEventDTO[] SlotFreed { get; } @@ -37,6 +40,7 @@ namespace CodexContractsPlugin.ChainMonitor all.AddRange(Requests); all.AddRange(Fulfilled); all.AddRange(Cancelled); + all.AddRange(Failed); all.AddRange(SlotFilled); all.AddRange(SlotFreed); return all.ToArray(); @@ -60,6 +64,7 @@ namespace CodexContractsPlugin.ChainMonitor events.GetStorageRequests(), events.GetRequestFulfilledEvents(), events.GetRequestCancelledEvents(), + events.GetRequestFailedEvents(), events.GetSlotFilledEvents(), events.GetSlotFreedEvents() ); diff --git a/ProjectPlugins/CodexContractsPlugin/ChainMonitor/ChainState.cs b/ProjectPlugins/CodexContractsPlugin/ChainMonitor/ChainState.cs index 23ac7dc..fba622b 100644 --- a/ProjectPlugins/CodexContractsPlugin/ChainMonitor/ChainState.cs +++ b/ProjectPlugins/CodexContractsPlugin/ChainMonitor/ChainState.cs @@ -13,6 +13,7 @@ namespace CodexContractsPlugin.ChainMonitor void OnRequestFinished(RequestEvent requestEvent); void OnRequestFulfilled(RequestEvent requestEvent); void OnRequestCancelled(RequestEvent requestEvent); + void OnRequestFailed(RequestEvent requestEvent); void OnSlotFilled(RequestEvent requestEvent, EthAddress host, BigInteger slotIndex); void OnSlotFreed(RequestEvent requestEvent, BigInteger slotIndex); } @@ -41,15 +42,12 @@ namespace CodexContractsPlugin.ChainMonitor this.log = new LogPrefixer(log, "(ChainState) "); this.contracts = contracts; handler = changeHandler; - StartUtc = startUtc; TotalSpan = new TimeRange(startUtc, startUtc); } public TimeRange TotalSpan { get; private set; } public IChainStateRequest[] Requests => requests.ToArray(); - public DateTime StartUtc { get; } - public void Update() { Update(DateTime.UtcNow); @@ -124,6 +122,14 @@ namespace CodexContractsPlugin.ChainMonitor handler.OnRequestCancelled(new RequestEvent(@event.Block, r)); } + private void ApplyEvent(RequestFailedEventDTO @event) + { + var r = FindRequest(@event.RequestId); + if (r == null) return; + r.UpdateState(@event.Block.BlockNumber, RequestState.Failed); + handler.OnRequestFailed(new RequestEvent(@event.Block, r)); + } + private void ApplyEvent(SlotFilledEventDTO @event) { var r = FindRequest(@event.RequestId); diff --git a/ProjectPlugins/CodexContractsPlugin/ChainMonitor/ChainStateChangeHandlerMux.cs b/ProjectPlugins/CodexContractsPlugin/ChainMonitor/ChainStateChangeHandlerMux.cs new file mode 100644 index 0000000..36ae46e --- /dev/null +++ b/ProjectPlugins/CodexContractsPlugin/ChainMonitor/ChainStateChangeHandlerMux.cs @@ -0,0 +1,55 @@ +using GethPlugin; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Numerics; +using System.Text; +using System.Threading.Tasks; + +namespace CodexContractsPlugin.ChainMonitor +{ + public class ChainStateChangeHandlerMux : IChainStateChangeHandler + { + public ChainStateChangeHandlerMux(params IChainStateChangeHandler[] handlers) + { + Handlers = handlers.ToList(); + } + + public List Handlers { get; } = new List(); + + public void OnNewRequest(RequestEvent requestEvent) + { + foreach (var handler in Handlers) handler.OnNewRequest(requestEvent); + } + + public void OnRequestCancelled(RequestEvent requestEvent) + { + foreach (var handler in Handlers) handler.OnRequestCancelled(requestEvent); + } + + public void OnRequestFailed(RequestEvent requestEvent) + { + foreach (var handler in Handlers) handler.OnRequestFailed(requestEvent); + } + + public void OnRequestFinished(RequestEvent requestEvent) + { + foreach (var handler in Handlers) handler.OnRequestFinished(requestEvent); + } + + public void OnRequestFulfilled(RequestEvent requestEvent) + { + foreach (var handler in Handlers) handler.OnRequestFulfilled(requestEvent); + } + + public void OnSlotFilled(RequestEvent requestEvent, EthAddress host, BigInteger slotIndex) + { + foreach (var handler in Handlers) handler.OnSlotFilled(requestEvent, host, slotIndex); + } + + public void OnSlotFreed(RequestEvent requestEvent, BigInteger slotIndex) + { + foreach (var handler in Handlers) handler.OnSlotFreed(requestEvent, slotIndex); + } + } +} diff --git a/ProjectPlugins/CodexContractsPlugin/ChainMonitor/DoNothingChainEventHandler.cs b/ProjectPlugins/CodexContractsPlugin/ChainMonitor/DoNothingChainEventHandler.cs index c564ec8..812cfd6 100644 --- a/ProjectPlugins/CodexContractsPlugin/ChainMonitor/DoNothingChainEventHandler.cs +++ b/ProjectPlugins/CodexContractsPlugin/ChainMonitor/DoNothingChainEventHandler.cs @@ -13,6 +13,10 @@ namespace CodexContractsPlugin.ChainMonitor { } + public void OnRequestFailed(RequestEvent requestEvent) + { + } + public void OnRequestFinished(RequestEvent requestEvent) { } diff --git a/ProjectPlugins/CodexContractsPlugin/CodexContractsEvents.cs b/ProjectPlugins/CodexContractsPlugin/CodexContractsEvents.cs index cf7b2d7..57a5371 100644 --- a/ProjectPlugins/CodexContractsPlugin/CodexContractsEvents.cs +++ b/ProjectPlugins/CodexContractsPlugin/CodexContractsEvents.cs @@ -13,6 +13,7 @@ namespace CodexContractsPlugin Request[] GetStorageRequests(); RequestFulfilledEventDTO[] GetRequestFulfilledEvents(); RequestCancelledEventDTO[] GetRequestCancelledEvents(); + RequestFailedEventDTO[] GetRequestFailedEvents(); SlotFilledEventDTO[] GetSlotFilledEvents(); SlotFreedEventDTO[] GetSlotFreedEvents(); } @@ -71,6 +72,17 @@ namespace CodexContractsPlugin }).ToArray(); } + public RequestFailedEventDTO[] GetRequestFailedEvents() + { + var events = gethNode.GetEvents(deployment.MarketplaceAddress, BlockInterval); + return events.Select(e => + { + var result = e.Event; + result.Block = GetBlock(e.Log.BlockNumber.ToUlong()); + return result; + }).ToArray(); + } + public SlotFilledEventDTO[] GetSlotFilledEvents() { var events = gethNode.GetEvents(deployment.MarketplaceAddress, BlockInterval); diff --git a/ProjectPlugins/CodexContractsPlugin/Marketplace/Customizations.cs b/ProjectPlugins/CodexContractsPlugin/Marketplace/Customizations.cs index 4331143..d842a9e 100644 --- a/ProjectPlugins/CodexContractsPlugin/Marketplace/Customizations.cs +++ b/ProjectPlugins/CodexContractsPlugin/Marketplace/Customizations.cs @@ -40,6 +40,12 @@ namespace CodexContractsPlugin.Marketplace public BlockTimeEntry Block { get; set; } } + public partial class RequestFailedEventDTO : IHasBlock + { + [JsonIgnore] + public BlockTimeEntry Block { get; set; } + } + public partial class SlotFilledEventDTO : IHasBlock { [JsonIgnore] diff --git a/Tests/FrameworkTests/Utils/TimeTests.cs b/Tests/FrameworkTests/Utils/TimeTests.cs index 207b338..2094528 100644 --- a/Tests/FrameworkTests/Utils/TimeTests.cs +++ b/Tests/FrameworkTests/Utils/TimeTests.cs @@ -21,5 +21,16 @@ namespace FrameworkTests.Utils TimeSpan.FromSeconds(28) )); } + + [Test] + public void Averaging() + { + var first = RollingAverage.GetNewAverage(0.0f, 1, 1.0f); + Assert.That(first, Is.EqualTo(1.0f)); + + var fifth = RollingAverage.GetNewAverage(5.0f, 5, 0.0f); + var expected = new[] { 5.0f, 5.0f, 5.0f, 5.0f, 0.0f }.Average(); + Assert.That(fifth, Is.EqualTo(expected)); + } } } diff --git a/Tools/MarketInsights/AppState.cs b/Tools/MarketInsights/AppState.cs new file mode 100644 index 0000000..8a49f25 --- /dev/null +++ b/Tools/MarketInsights/AppState.cs @@ -0,0 +1,13 @@ +namespace MarketInsights +{ + public class AppState + { + public AppState(Configuration config) + { + Config = config; + } + + public MarketOverview MarketOverview { get; set; } = new (); + public Configuration Config { get; } + } +} diff --git a/Tools/MarketInsights/AverageHistory.cs b/Tools/MarketInsights/AverageHistory.cs new file mode 100644 index 0000000..d0b4350 --- /dev/null +++ b/Tools/MarketInsights/AverageHistory.cs @@ -0,0 +1,71 @@ +using CodexContractsPlugin.ChainMonitor; +using GethPlugin; +using System.Numerics; +using Utils; + +namespace MarketInsights +{ + public class AverageHistory + { + public readonly List contributions = new List(); + + } + + public class ContributionBuilder : IChainStateChangeHandler + { + private readonly MarketTimeSegment segment = new MarketTimeSegment(); + + public void OnNewRequest(RequestEvent requestEvent) + { + AddRequestToAverage(segment.Submitted, requestEvent); + } + + public void OnRequestCancelled(RequestEvent requestEvent) + { + AddRequestToAverage(segment.Expired, requestEvent); + } + + public void OnRequestFailed(RequestEvent requestEvent) + { + AddRequestToAverage(segment.Failed, requestEvent); + } + + public void OnRequestFinished(RequestEvent requestEvent) + { + AddRequestToAverage(segment.Finished, requestEvent); + } + + public void OnRequestFulfilled(RequestEvent requestEvent) + { + AddRequestToAverage(segment.Started, requestEvent); + } + + public void OnSlotFilled(RequestEvent requestEvent, EthAddress host, BigInteger slotIndex) + { + } + + public void OnSlotFreed(RequestEvent requestEvent, BigInteger slotIndex) + { + } + + private void AddRequestToAverage(ContractAverages average, RequestEvent requestEvent) + { + average.Number++; + average.Price = GetNewAverage(average.Price, average.Number, requestEvent.Request.Request.Ask.Reward); + average.Size = GetNewAverage(average.Size, average.Number, requestEvent.Request.Request.Ask.SlotSize); + average.Duration = GetNewAverage(average.Duration, average.Number, requestEvent.Request.Request.Ask.Duration); + average.Collateral = GetNewAverage(average.Collateral, average.Number, requestEvent.Request.Request.Ask.Collateral); + average.ProofProbability = GetNewAverage(average.ProofProbability, average.Number, requestEvent.Request.Request.Ask.ProofProbability); + } + + private float GetNewAverage(float currentAverage, int newNumberOfValues, BigInteger newValue) + { + return GetNewAverage(currentAverage, newNumberOfValues, (float)newValue); + } + + private float GetNewAverage(float currentAverage, int newNumberOfValues, float newValue) + { + return RollingAverage.GetNewAverage(currentAverage, newNumberOfValues, newValue); + } + } +} diff --git a/Tools/MarketInsights/Configuration.cs b/Tools/MarketInsights/Configuration.cs new file mode 100644 index 0000000..f8fa574 --- /dev/null +++ b/Tools/MarketInsights/Configuration.cs @@ -0,0 +1,37 @@ +using ArgsUniform; + +namespace MarketInsights +{ + public class Configuration + { + [Uniform("interval-minutes", "im", "INTERVALMINUTES", true, "time in minutes between updates.")] + public int UpdateIntervalMinutes { get; set; } = 10; + + [Uniform("max-random-seconds", "mrs", "MAXRANDOMSECONDS", false, "maximum random number of seconds added to update delay.")] + public int MaxRandomIntervalSeconds { get; set; } = 120; + + [Uniform("check-history", "ch", "CHECKHISTORY", true, "Unix epoc timestamp of a moment in history on which processing begins. Should be 'launch of the testnet'.")] + public int CheckHistoryTimestamp { get; set; } = 0; + + /// + /// 6 = 1h + /// 144 = 24h + /// 2520 = 1 week + /// 10080 = 4 weeks + /// + [Uniform("timesegments", "ts", "TIMESEGMENTS", false, "Semi-colon separated integers. Each represents a multiple of intervals, for which a market timesegment will be generated.")] + public string TimeSegments { get; set; } = "6;144;2520;10080"; + + [Uniform("fullhistory", "fh", "FULLHISTORY", false, "When not zero, market timesegment for 'entire history' will be included.")] + public int FullHistory { get; set; } = 1; + + public DateTime HistoryStartUtc + { + get + { + if (CheckHistoryTimestamp == 0) throw new Exception("'check-history' unix timestamp is required. Set it to the start/launch moment of the testnet."); + return DateTimeOffset.FromUnixTimeSeconds(CheckHistoryTimestamp).UtcDateTime; + } + } + } +} diff --git a/Tools/MarketInsights/Controllers/MarketController.cs b/Tools/MarketInsights/Controllers/MarketController.cs index 9a6b5a8..2ca608c 100644 --- a/Tools/MarketInsights/Controllers/MarketController.cs +++ b/Tools/MarketInsights/Controllers/MarketController.cs @@ -6,13 +6,20 @@ namespace MarketInsights.Controllers [Route("[controller]")] public class MarketController : ControllerBase { + private readonly AppState appState; + + public MarketController(AppState appState) + { + this.appState = appState; + } + /// /// Gets the most recent market overview. /// [HttpGet] public MarketOverview Get() { - return new MarketOverview(); + return appState.MarketOverview; } } } diff --git a/Tools/MarketInsights/MarketInsights.csproj b/Tools/MarketInsights/MarketInsights.csproj index b1d65bd..08ec3d7 100644 --- a/Tools/MarketInsights/MarketInsights.csproj +++ b/Tools/MarketInsights/MarketInsights.csproj @@ -16,4 +16,9 @@ + + + + + diff --git a/Tools/MarketInsights/Model.cs b/Tools/MarketInsights/Model.cs index 8d44c3c..06057ca 100644 --- a/Tools/MarketInsights/Model.cs +++ b/Tools/MarketInsights/Model.cs @@ -2,6 +2,11 @@ { public class MarketOverview { + /// + /// Moment when overview was last updated. + /// + public DateTime LastUpdatedUtc { get; set; } + public MarketTimeSegment[] TimeSegments { get; set; } = Array.Empty(); } diff --git a/Tools/MarketInsights/Program.cs b/Tools/MarketInsights/Program.cs index 760705a..07f5853 100644 --- a/Tools/MarketInsights/Program.cs +++ b/Tools/MarketInsights/Program.cs @@ -1,4 +1,4 @@ - +using ArgsUniform; using Microsoft.Extensions.Options; using System.Reflection; @@ -8,9 +8,15 @@ namespace MarketInsights { public static void Main(string[] args) { + var uniformArgs = new ArgsUniform(PrintHelp, args); + var config = uniformArgs.Parse(true); + + var appState = new AppState(config); + var updater = new Updater(appState); + var builder = WebApplication.CreateBuilder(args); - // Add services to the container. + builder.Services.AddSingleton(appState); builder.Services.AddControllers(); // Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle @@ -34,10 +40,15 @@ namespace MarketInsights app.UseAuthorization(); - app.MapControllers(); + updater.Run(); app.Run(); } + + private static void PrintHelp() + { + Console.WriteLine("WebAPI for generating market overview for Codex network. Comes with OpenAPI swagger endpoint."); + } } } diff --git a/Tools/MarketInsights/Updater.cs b/Tools/MarketInsights/Updater.cs new file mode 100644 index 0000000..11419c9 --- /dev/null +++ b/Tools/MarketInsights/Updater.cs @@ -0,0 +1,35 @@ + +namespace MarketInsights +{ + public class Updater + { + private readonly AppState appState; + private readonly Tracker[] trackers; + + public Updater(AppState appState) + { + this.appState = appState; + trackers = CreateTrackers(); + } + + private Tracker[] CreateTrackers() + { + var tokens = appState.Config.TimeSegments.Split(";", StringSplitOptions.RemoveEmptyEntries); + var nums = tokens.Select(t => Convert.ToInt32(t)).ToArray(); + return nums.Select(n => new Tracker(n)).ToArray(); + } + + public void Run() + { + + } + } + + public class Tracker + { + public Tracker(int numberOfSegments) + { + + } + } +} diff --git a/Tools/TestNetRewarder/ChainChangeMux.cs b/Tools/TestNetRewarder/ChainChangeMux.cs deleted file mode 100644 index f906a20..0000000 --- a/Tools/TestNetRewarder/ChainChangeMux.cs +++ /dev/null @@ -1,46 +0,0 @@ -using CodexContractsPlugin.ChainMonitor; -using GethPlugin; -using System.Numerics; - -namespace TestNetRewarder -{ - public class ChainChangeMux : IChainStateChangeHandler - { - private readonly IChainStateChangeHandler[] handlers; - - public ChainChangeMux(params IChainStateChangeHandler[] handlers) - { - this.handlers = handlers; - } - - public void OnNewRequest(RequestEvent requestEvent) - { - foreach (var handler in handlers) handler.OnNewRequest(requestEvent); - } - - public void OnRequestCancelled(RequestEvent requestEvent) - { - foreach (var handler in handlers) handler.OnRequestCancelled(requestEvent); - } - - public void OnRequestFinished(RequestEvent requestEvent) - { - foreach (var handler in handlers) handler.OnRequestFinished(requestEvent); - } - - public void OnRequestFulfilled(RequestEvent requestEvent) - { - foreach (var handler in handlers) handler.OnRequestFulfilled(requestEvent); - } - - public void OnSlotFilled(RequestEvent requestEvent, EthAddress host, BigInteger slotIndex) - { - foreach (var handler in handlers) handler.OnSlotFilled(requestEvent, host, slotIndex); - } - - public void OnSlotFreed(RequestEvent requestEvent, BigInteger slotIndex) - { - foreach (var handler in handlers) handler.OnSlotFreed(requestEvent, slotIndex); - } - } -} diff --git a/Tools/TestNetRewarder/EventsFormatter.cs b/Tools/TestNetRewarder/EventsFormatter.cs index 048a3a5..1029eb7 100644 --- a/Tools/TestNetRewarder/EventsFormatter.cs +++ b/Tools/TestNetRewarder/EventsFormatter.cs @@ -44,6 +44,11 @@ namespace TestNetRewarder AddRequestBlock(requestEvent, "Cancelled"); } + public void OnRequestFailed(RequestEvent requestEvent) + { + AddRequestBlock(requestEvent, "Failed"); + } + public void OnRequestFinished(RequestEvent requestEvent) { AddRequestBlock(requestEvent, "Finished"); diff --git a/Tools/TestNetRewarder/MarketTracker.cs b/Tools/TestNetRewarder/MarketTracker.cs index 981c51c..2c0be48 100644 --- a/Tools/TestNetRewarder/MarketTracker.cs +++ b/Tools/TestNetRewarder/MarketTracker.cs @@ -70,5 +70,10 @@ namespace TestNetRewarder } return Array.Empty(); } + + public void OnRequestFailed(RequestEvent requestEvent) + { + throw new NotImplementedException("being removed"); + } } } diff --git a/Tools/TestNetRewarder/Processor.cs b/Tools/TestNetRewarder/Processor.cs index 642be07..1572335 100644 --- a/Tools/TestNetRewarder/Processor.cs +++ b/Tools/TestNetRewarder/Processor.cs @@ -25,7 +25,7 @@ namespace TestNetRewarder marketTracker = new MarketTracker(config, log); eventsFormatter = new EventsFormatter(); - var handler = new ChainChangeMux( + var handler = new ChainStateChangeHandlerMux( rewardChecker.Handler, marketTracker, eventsFormatter diff --git a/Tools/TestNetRewarder/RewardCheck.cs b/Tools/TestNetRewarder/RewardCheck.cs index c01e083..dc93323 100644 --- a/Tools/TestNetRewarder/RewardCheck.cs +++ b/Tools/TestNetRewarder/RewardCheck.cs @@ -34,6 +34,10 @@ namespace TestNetRewarder { } + public void OnRequestFailed(RequestEvent requestEvent) + { + } + public void OnRequestFinished(RequestEvent requestEvent) { if (MeetsRequirements(CheckType.HostFinishedSlot, requestEvent)) diff --git a/Tools/TestNetRewarder/RewardChecker.cs b/Tools/TestNetRewarder/RewardChecker.cs index 0d22baf..f8e500c 100644 --- a/Tools/TestNetRewarder/RewardChecker.cs +++ b/Tools/TestNetRewarder/RewardChecker.cs @@ -9,7 +9,7 @@ namespace TestNetRewarder { var repo = new RewardRepo(); var checks = repo.Rewards.Select(r => new RewardCheck(r, giver)).ToArray(); - Handler = new ChainChangeMux(checks); + Handler = new ChainStateChangeHandlerMux(checks); } public IChainStateChangeHandler Handler { get; }