merge finished

This commit is contained in:
Ben 2025-06-04 12:56:26 +02:00
parent 3822d5e2eb
commit 64d271c809
No known key found for this signature in database
GPG Key ID: 0F16E812E736C24B
3 changed files with 12 additions and 4 deletions

View File

@ -47,7 +47,7 @@ namespace CodexContractsPlugin.ChainMonitor
handler = changeHandler;
this.doProofPeriodMonitoring = doProofPeriodMonitoring;
TotalSpan = new TimeRange(startUtc, startUtc);
PeriodMonitor = new PeriodMonitor(contracts);
PeriodMonitor = new PeriodMonitor(log, contracts);
}
public TimeRange TotalSpan { get; private set; }

View File

@ -96,7 +96,8 @@ namespace CodexContractsPlugin.Marketplace
public partial class MarketplaceConfig : IMarketplaceConfigInput
{
public int MaxNumberOfSlashes => this.Collateral.MaxNumberOfSlashes;
public TimeSpan PeriodDuration => TimeSpan.FromSeconds(this.Proofs.Period);
}
}
#pragma warning restore CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.

View File

@ -53,11 +53,15 @@ namespace CodexReleaseTests.Utils
protected abstract ByteSize HostAvailabilitySize { get; }
protected abstract TimeSpan HostAvailabilityMaxDuration { get; }
protected virtual bool MonitorChainState { get; } = true;
protected TimeSpan HostBlockTTL { get; } = TimeSpan.FromMinutes(1.0);
public ICodexNodeGroup StartHosts()
{
var hosts = StartCodex(NumberOfHosts, s => s
.WithName("host")
.WithBlockTTL(HostBlockTTL)
.WithBlockMaintenanceNumber(1000)
.WithBlockMaintenanceInterval(HostBlockTTL / 2)
.EnableMarketplace(GetGeth(), GetContracts(), m => m
.WithInitial(StartingBalanceEth.Eth(), StartingBalanceTST.Tst())
.AsStorageNode()
@ -70,7 +74,7 @@ namespace CodexReleaseTests.Utils
AssertTstBalance(host, StartingBalanceTST.Tst(), nameof(StartHosts));
AssertEthBalance(host, StartingBalanceEth.Eth(), nameof(StartHosts));
host.Marketplace.MakeStorageAvailable(new StorageAvailability(
host.Marketplace.MakeStorageAvailable(new CreateStorageAvailability(
totalSpace: HostAvailabilitySize,
maxDuration: HostAvailabilityMaxDuration,
minPricePerBytePerSecond: 1.TstWei(),
@ -84,6 +88,9 @@ namespace CodexReleaseTests.Utils
{
var host = StartCodex(s => s
.WithName("singlehost")
.WithBlockTTL(HostBlockTTL)
.WithBlockMaintenanceNumber(1000)
.WithBlockMaintenanceInterval(HostBlockTTL / 2)
.EnableMarketplace(GetGeth(), GetContracts(), m => m
.WithInitial(StartingBalanceEth.Eth(), StartingBalanceTST.Tst())
.AsStorageNode()
@ -94,7 +101,7 @@ namespace CodexReleaseTests.Utils
AssertTstBalance(host, StartingBalanceTST.Tst(), nameof(StartOneHost));
AssertEthBalance(host, StartingBalanceEth.Eth(), nameof(StartOneHost));
host.Marketplace.MakeStorageAvailable(new StorageAvailability(
host.Marketplace.MakeStorageAvailable(new CreateStorageAvailability(
totalSpace: HostAvailabilitySize,
maxDuration: HostAvailabilityMaxDuration,
minPricePerBytePerSecond: 1.TstWei(),