2024-06-17 15:34:08 +02:00
|
|
|
|
using CodexContractsPlugin.ChainMonitor;
|
2024-06-27 10:07:10 +02:00
|
|
|
|
using GethPlugin;
|
2024-06-17 15:34:08 +02:00
|
|
|
|
using System.Numerics;
|
|
|
|
|
|
|
|
|
|
namespace TestNetRewarder
|
|
|
|
|
{
|
|
|
|
|
public class ChainChangeMux : IChainStateChangeHandler
|
|
|
|
|
{
|
|
|
|
|
private readonly IChainStateChangeHandler[] handlers;
|
|
|
|
|
|
|
|
|
|
public ChainChangeMux(params IChainStateChangeHandler[] handlers)
|
|
|
|
|
{
|
|
|
|
|
this.handlers = handlers;
|
|
|
|
|
}
|
|
|
|
|
|
2024-06-27 11:43:25 +02:00
|
|
|
|
public void OnNewRequest(RequestEvent requestEvent)
|
2024-06-17 15:34:08 +02:00
|
|
|
|
{
|
2024-06-27 11:43:25 +02:00
|
|
|
|
foreach (var handler in handlers) handler.OnNewRequest(requestEvent);
|
2024-06-17 15:34:08 +02:00
|
|
|
|
}
|
|
|
|
|
|
2024-06-27 11:43:25 +02:00
|
|
|
|
public void OnRequestCancelled(RequestEvent requestEvent)
|
2024-06-17 15:34:08 +02:00
|
|
|
|
{
|
2024-06-27 11:43:25 +02:00
|
|
|
|
foreach (var handler in handlers) handler.OnRequestCancelled(requestEvent);
|
2024-06-17 15:34:08 +02:00
|
|
|
|
}
|
|
|
|
|
|
2024-06-27 11:43:25 +02:00
|
|
|
|
public void OnRequestFinished(RequestEvent requestEvent)
|
2024-06-17 15:34:08 +02:00
|
|
|
|
{
|
2024-06-27 11:43:25 +02:00
|
|
|
|
foreach (var handler in handlers) handler.OnRequestFinished(requestEvent);
|
2024-06-17 15:34:08 +02:00
|
|
|
|
}
|
|
|
|
|
|
2024-06-27 11:43:25 +02:00
|
|
|
|
public void OnRequestFulfilled(RequestEvent requestEvent)
|
2024-06-17 15:34:08 +02:00
|
|
|
|
{
|
2024-06-27 11:43:25 +02:00
|
|
|
|
foreach (var handler in handlers) handler.OnRequestFulfilled(requestEvent);
|
2024-06-17 15:34:08 +02:00
|
|
|
|
}
|
|
|
|
|
|
2024-06-27 11:43:25 +02:00
|
|
|
|
public void OnSlotFilled(RequestEvent requestEvent, EthAddress host, BigInteger slotIndex)
|
2024-06-17 15:34:08 +02:00
|
|
|
|
{
|
2024-06-27 11:43:25 +02:00
|
|
|
|
foreach (var handler in handlers) handler.OnSlotFilled(requestEvent, host, slotIndex);
|
2024-06-17 15:34:08 +02:00
|
|
|
|
}
|
|
|
|
|
|
2024-06-27 11:43:25 +02:00
|
|
|
|
public void OnSlotFreed(RequestEvent requestEvent, BigInteger slotIndex)
|
2024-06-17 15:34:08 +02:00
|
|
|
|
{
|
2024-06-27 11:43:25 +02:00
|
|
|
|
foreach (var handler in handlers) handler.OnSlotFreed(requestEvent, slotIndex);
|
2024-06-17 15:34:08 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|