Find bug in blocktime finder
This commit is contained in:
parent
a6b0b16909
commit
be268ace42
|
@ -71,8 +71,6 @@ namespace CodexTests.BasicTests
|
||||||
.AsStorageNode()
|
.AsStorageNode()
|
||||||
.AsValidator()));
|
.AsValidator()));
|
||||||
|
|
||||||
AssertBalance(contracts, seller, Is.EqualTo(sellerInitialBalance));
|
|
||||||
|
|
||||||
var availability = new StorageAvailability(
|
var availability = new StorageAvailability(
|
||||||
totalSpace: 10.GB(),
|
totalSpace: 10.GB(),
|
||||||
maxDuration: TimeSpan.FromMinutes(30),
|
maxDuration: TimeSpan.FromMinutes(30),
|
||||||
|
@ -90,8 +88,6 @@ namespace CodexTests.BasicTests
|
||||||
.WithAccount(myAccount)
|
.WithAccount(myAccount)
|
||||||
.WithInitial(10.Eth(), buyerInitialBalance)));
|
.WithInitial(10.Eth(), buyerInitialBalance)));
|
||||||
|
|
||||||
AssertBalance(contracts, buyer, Is.EqualTo(buyerInitialBalance));
|
|
||||||
|
|
||||||
var contentId = buyer.UploadFile(testFile);
|
var contentId = buyer.UploadFile(testFile);
|
||||||
|
|
||||||
var purchase = new StoragePurchaseRequest(contentId)
|
var purchase = new StoragePurchaseRequest(contentId)
|
||||||
|
|
|
@ -117,6 +117,41 @@ namespace FrameworkTests.NethereumWorkflow
|
||||||
|
|
||||||
Assert.That(notFound, Is.Null);
|
Assert.That(notFound, Is.Null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void FailsToFindBlockBeforeFrontOfChain_history()
|
||||||
|
{
|
||||||
|
var first = blocks.First().Value;
|
||||||
|
|
||||||
|
var notFound = finder.GetHighestBlockNumberBefore(first.JustBefore);
|
||||||
|
|
||||||
|
Assert.That(notFound, Is.Null);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void FailsToFindBlockAfterTailOfChain_future()
|
||||||
|
{
|
||||||
|
var last = blocks.Last().Value;
|
||||||
|
|
||||||
|
var notFound = finder.GetLowestBlockNumberAfter(last.JustAfter);
|
||||||
|
|
||||||
|
Assert.That(notFound, Is.Null);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void RunThrough()
|
||||||
|
{
|
||||||
|
foreach (var pair in blocks)
|
||||||
|
{
|
||||||
|
finder.GetHighestBlockNumberBefore(pair.Value.JustBefore);
|
||||||
|
finder.GetHighestBlockNumberBefore(pair.Value.Time);
|
||||||
|
finder.GetHighestBlockNumberBefore(pair.Value.JustAfter);
|
||||||
|
|
||||||
|
finder.GetLowestBlockNumberAfter(pair.Value.JustBefore);
|
||||||
|
finder.GetLowestBlockNumberAfter(pair.Value.Time);
|
||||||
|
finder.GetLowestBlockNumberAfter(pair.Value.JustAfter);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class Block
|
public class Block
|
||||||
|
|
Loading…
Reference in New Issue