mirror of
https://github.com/logos-storage/logos-storage-nim-cs-dist-tests.git
synced 2026-01-02 13:33:07 +00:00
Adds will-be-required to log
This commit is contained in:
parent
e03f5982d3
commit
74dbdfba17
@ -32,6 +32,7 @@ namespace CodexContractsPlugin
|
||||
TimeRange GetPeriodTimeRange(ulong periodNumber);
|
||||
void WaitUntilNextPeriod();
|
||||
bool IsProofRequired(byte[] requestId, decimal slotIndex);
|
||||
bool WillProofBeRequired(byte[] requestId, decimal slotIndex);
|
||||
byte[] GetSlotId(byte[] requestId, decimal slotIndex);
|
||||
|
||||
ICodexContracts WithDifferentGeth(IGethNode node);
|
||||
@ -172,6 +173,12 @@ namespace CodexContractsPlugin
|
||||
return IsProofRequired(slotId);
|
||||
}
|
||||
|
||||
public bool WillProofBeRequired(byte[] requestId, decimal slotIndex)
|
||||
{
|
||||
var slotId = GetSlotId(requestId, slotIndex);
|
||||
return WillProofBeRequired(slotId);
|
||||
}
|
||||
|
||||
public ICodexContracts WithDifferentGeth(IGethNode node)
|
||||
{
|
||||
return new CodexContractsAccess(log, node, Deployment);
|
||||
@ -198,6 +205,16 @@ namespace CodexContractsPlugin
|
||||
return result.ReturnValue1;
|
||||
}
|
||||
|
||||
private bool WillProofBeRequired(byte[] slotId)
|
||||
{
|
||||
var func = new WillProofBeRequiredFunction
|
||||
{
|
||||
Id = slotId
|
||||
};
|
||||
var result = gethNode.Call<WillProofBeRequiredFunction, WillProofBeRequiredOutputDTO>(Deployment.MarketplaceAddress, func);
|
||||
return result.ReturnValue1;
|
||||
}
|
||||
|
||||
private ContractInteractions StartInteraction()
|
||||
{
|
||||
return new ContractInteractions(log, gethNode);
|
||||
|
||||
@ -51,16 +51,20 @@ namespace CodexReleaseTests.MarketTests
|
||||
{
|
||||
Thread.Sleep(TimeSpan.FromSeconds(1));
|
||||
var requiredSlotIndices = new List<int>();
|
||||
var willRequireSlotIndices = new List<int>();
|
||||
for (var i = 0; i < numSlots; i++)
|
||||
{
|
||||
if (GetContracts().IsProofRequired(requestId, i)) requiredSlotIndices.Add(i);
|
||||
if (GetContracts().WillProofBeRequired(requestId, i)) willRequireSlotIndices.Add(i);
|
||||
}
|
||||
|
||||
var periodNumber = GetContracts().GetPeriodNumber(DateTime.UtcNow);
|
||||
var blockNumber = GetGeth().GetSyncedBlockNumber();
|
||||
Log($"[{blockNumber?.ToString().PadLeft(4, '0')}]" +
|
||||
$"{periodNumber.ToString().PadLeft(12, '0')} => " +
|
||||
$"{string.Join(",", requiredSlotIndices.Select(i => i.ToString()))}");
|
||||
$"{periodNumber.ToString().PadLeft(12, '0')} => Required now: " +
|
||||
$"[{string.Join(",", requiredSlotIndices.Select(i => i.ToString()))}] " +
|
||||
$"Will be required: " +
|
||||
$"[{string.Join(",", willRequireSlotIndices.Select(i => i.ToString()))}]");
|
||||
|
||||
//var num = currentPeriod.PeriodNumber;
|
||||
//if (!map.ContainsKey(num))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user