mirror of
https://github.com/logos-storage/logos-storage-nim-cs-dist-tests.git
synced 2026-01-07 16:03:07 +00:00
Fixes api mismatch in purchase status check
This commit is contained in:
parent
83e4cb2e04
commit
582c7326a1
@ -94,6 +94,10 @@
|
||||
private void CheckMaximums()
|
||||
{
|
||||
if (Duration() > maxTimeout) Fail();
|
||||
|
||||
// If we have a few very fast failures, retrying won't help us. There's probably something wrong with our operation.
|
||||
// In this case, don't wait the full duration and fail quickly.
|
||||
if (failures.Count > 5 && failures.All(f => f.Duration < TimeSpan.FromSeconds(1.0))) Fail();
|
||||
}
|
||||
|
||||
private void Fail()
|
||||
|
||||
@ -128,7 +128,7 @@ namespace CodexClient
|
||||
Content = Map(request.Content),
|
||||
Id = request.Id,
|
||||
Client = request.Client,
|
||||
Expiry = TimeSpan.FromSeconds(request.Expiry),
|
||||
Expiry = request.Expiry,
|
||||
Nonce = request.Nonce
|
||||
};
|
||||
}
|
||||
@ -137,12 +137,12 @@ namespace CodexClient
|
||||
{
|
||||
return new StorageAsk
|
||||
{
|
||||
Duration = TimeSpan.FromSeconds(ask.Duration),
|
||||
Duration = ask.Duration,
|
||||
MaxSlotLoss = ask.MaxSlotLoss,
|
||||
ProofProbability = ask.ProofProbability,
|
||||
PricePerBytePerSecond = ToTestToken(ask.PricePerBytePerSecond),
|
||||
PricePerBytePerSecond = ask.PricePerBytePerSecond,
|
||||
Slots = ask.Slots,
|
||||
SlotSize = ToByteSize(ask.SlotSize)
|
||||
SlotSize = ask.SlotSize
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@ -63,17 +63,17 @@ namespace CodexClient
|
||||
public string Client { get; set; } = string.Empty;
|
||||
public StorageAsk Ask { get; set; } = null!;
|
||||
public StorageContent Content { get; set; } = null!;
|
||||
public TimeSpan Expiry { get; set; }
|
||||
public long Expiry { get; set; }
|
||||
public string Nonce { get; set; } = string.Empty;
|
||||
}
|
||||
|
||||
public class StorageAsk
|
||||
{
|
||||
public long Slots { get; set; }
|
||||
public ByteSize SlotSize { get; set; } = 0.Bytes();
|
||||
public TimeSpan Duration { get; set; }
|
||||
public long SlotSize { get; set; }
|
||||
public long Duration { get; set; }
|
||||
public string ProofProbability { get; set; } = string.Empty;
|
||||
public TestToken PricePerBytePerSecond { get; set; } = 0.Tst();
|
||||
public string PricePerBytePerSecond { get; set; } = string.Empty;
|
||||
public long MaxSlotLoss { get; set; }
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user