diff --git a/DistTestCore/Codex/CodexContainerRecipe.cs b/DistTestCore/Codex/CodexContainerRecipe.cs index 0a35afe6..99e46f75 100644 --- a/DistTestCore/Codex/CodexContainerRecipe.cs +++ b/DistTestCore/Codex/CodexContainerRecipe.cs @@ -55,6 +55,10 @@ namespace DistTestCore.Codex { AddEnvVar("CODEX_BLOCK_MI", Convert.ToInt32(config.BlockMaintenanceInterval.Value.TotalSeconds).ToString()); } + if (config.BlockMaintenanceNumber != null) + { + AddEnvVar("CODEX_BLOCK_MN", config.BlockMaintenanceNumber.ToString()!); + } if (config.MetricsMode != Metrics.MetricsMode.None) { AddEnvVar("CODEX_METRICS", "true"); diff --git a/DistTestCore/Codex/CodexStartupConfig.cs b/DistTestCore/Codex/CodexStartupConfig.cs index 3dc92180..c09f066f 100644 --- a/DistTestCore/Codex/CodexStartupConfig.cs +++ b/DistTestCore/Codex/CodexStartupConfig.cs @@ -20,5 +20,6 @@ namespace DistTestCore.Codex public string? BootstrapSpr { get; set; } public int? BlockTTL { get; set; } public TimeSpan? BlockMaintenanceInterval { get; set; } + public int? BlockMaintenanceNumber { get; set; } } } diff --git a/DistTestCore/CodexSetup.cs b/DistTestCore/CodexSetup.cs index 1eb99d70..da5fa644 100644 --- a/DistTestCore/CodexSetup.cs +++ b/DistTestCore/CodexSetup.cs @@ -12,6 +12,7 @@ namespace DistTestCore ICodexSetup WithStorageQuota(ByteSize storageQuota); ICodexSetup WithBlockTTL(TimeSpan duration); ICodexSetup WithBlockMaintenanceInterval(TimeSpan duration); + ICodexSetup WithBlockMaintenanceNumber(int numberOfBlocks); ICodexSetup EnableMetrics(); ICodexSetup EnableMarketplace(TestToken initialBalance); ICodexSetup EnableMarketplace(TestToken initialBalance, Ether initialEther); @@ -64,6 +65,12 @@ namespace DistTestCore return this; } + public ICodexSetup WithBlockMaintenanceNumber(int numberOfBlocks) + { + BlockMaintenanceNumber = numberOfBlocks; + return this; + } + public ICodexSetup EnableMetrics() { MetricsMode = Metrics.MetricsMode.Record; diff --git a/Tests/BasicTests/ContinuousSubstitute.cs b/Tests/BasicTests/ContinuousSubstitute.cs index 20023e21..0f83651c 100644 --- a/Tests/BasicTests/ContinuousSubstitute.cs +++ b/Tests/BasicTests/ContinuousSubstitute.cs @@ -68,6 +68,7 @@ namespace Tests.BasicTests .EnableMarketplace(100000.TestTokens(), 0.Eth(), isValidator: true) .WithBlockTTL(TimeSpan.FromMinutes(2)) .WithBlockMaintenanceInterval(TimeSpan.FromMinutes(3)) + .WithBlockMaintenanceNumber(10000) .WithStorageQuota(3.GB())); var nodes = group.Cast().ToArray();