cs-codex-dist-tests/Framework/Utils/BlockInterval.cs

31 lines
666 B
C#
Raw Normal View History

2024-02-19 14:20:12 +00:00
namespace Utils
{
2024-03-27 14:39:42 +00:00
public class BlockInterval
2024-02-19 14:20:12 +00:00
{
2024-05-31 08:16:57 +00:00
public BlockInterval(TimeRange timeRange, ulong from, ulong to)
2024-02-19 14:20:12 +00:00
{
if (from < to)
{
From = from;
To = to;
}
else
{
From = to;
To = from;
}
2024-05-31 08:16:57 +00:00
TimeRange = timeRange;
2024-02-19 14:20:12 +00:00
}
public ulong From { get; }
public ulong To { get; }
2024-05-31 08:16:57 +00:00
public TimeRange TimeRange { get; }
public ulong NumberOfBlocks => To - From;
2024-02-19 14:41:48 +00:00
public override string ToString()
{
return $"[{From} - {To}]";
}
2024-02-19 14:20:12 +00:00
}
}