mirror of
https://github.com/logos-storage/logos-storage-nim-cs-dist-tests.git
synced 2026-01-03 22:13:10 +00:00
32 lines
707 B
C#
32 lines
707 B
C#
namespace Utils
|
|
{
|
|
public class BlockInterval
|
|
{
|
|
public BlockInterval(TimeRange timeRange, ulong from, ulong to)
|
|
{
|
|
if (from < to)
|
|
{
|
|
From = from;
|
|
To = to;
|
|
}
|
|
else
|
|
{
|
|
From = to;
|
|
To = from;
|
|
}
|
|
TimeRange = timeRange;
|
|
NumberOfBlocks = (To - From) + 1;
|
|
}
|
|
|
|
public ulong From { get; }
|
|
public ulong To { get; }
|
|
public TimeRange TimeRange { get; }
|
|
public ulong NumberOfBlocks { get; }
|
|
|
|
public override string ToString()
|
|
{
|
|
return $"[{From} - {To}]";
|
|
}
|
|
}
|
|
}
|