Fixes crash in blocktimefinder
This commit is contained in:
parent
be268ace42
commit
d7c7d47a61
|
@ -70,7 +70,7 @@ namespace NethereumWorkflow.BlockUtils
|
||||||
{
|
{
|
||||||
var next = GetBlock(entry.BlockNumber + 1);
|
var next = GetBlock(entry.BlockNumber + 1);
|
||||||
return
|
return
|
||||||
entry.Utc < target &&
|
entry.Utc <= target &&
|
||||||
next.Utc > target;
|
next.Utc > target;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -78,7 +78,7 @@ namespace NethereumWorkflow.BlockUtils
|
||||||
{
|
{
|
||||||
var previous = GetBlock(entry.BlockNumber - 1);
|
var previous = GetBlock(entry.BlockNumber - 1);
|
||||||
return
|
return
|
||||||
entry.Utc > target &&
|
entry.Utc >= target &&
|
||||||
previous.Utc < target;
|
previous.Utc < target;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -166,5 +166,10 @@ namespace FrameworkTests.NethereumWorkflow
|
||||||
public DateTime Time { get; }
|
public DateTime Time { get; }
|
||||||
public DateTime JustBefore { get { return Time.AddSeconds(-1); } }
|
public DateTime JustBefore { get { return Time.AddSeconds(-1); } }
|
||||||
public DateTime JustAfter { get { return Time.AddSeconds(1); } }
|
public DateTime JustAfter { get { return Time.AddSeconds(1); } }
|
||||||
|
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
return $"[{Number}]";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue