2
0
mirror of synced 2025-02-06 05:34:34 +00:00

46 lines
1.2 KiB
C#
Raw Normal View History

2024-11-21 15:10:53 +01:00
using CodexContractsPlugin;
2024-11-21 15:30:56 +01:00
using CodexPlugin;
2024-11-21 15:10:53 +01:00
using NUnit.Framework;
using System;
2024-11-21 10:03:09 +01:00
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
2024-11-21 15:30:56 +01:00
using Utils;
2024-11-21 10:03:09 +01:00
namespace CodexReleaseTests.MarketTests
{
2024-11-21 15:10:53 +01:00
[TestFixture]
2024-11-21 15:30:56 +01:00
public class ContractSuccessfulTest : MarketplaceAutoBootstrapDistTest
2024-11-21 10:03:09 +01:00
{
2024-11-21 15:30:56 +01:00
private const int NumberOfHosts = 4;
private const int FilesizeMb = 10;
2024-11-21 15:10:53 +01:00
[Test]
public void ContractSuccessful()
{
2024-11-21 15:30:56 +01:00
var hosts = StartHosts();
var client = StartCodex(s => s.WithName("client"));
}
private ICodexNodeGroup StartHosts()
{
var hosts = StartCodex(NumberOfHosts, s => s.WithName("host"));
2024-11-21 15:10:53 +01:00
2024-11-21 15:30:56 +01:00
var config = GetContracts().Deployment.Config;
foreach (var host in hosts)
{
host.Marketplace.MakeStorageAvailable(new CodexPlugin.StorageAvailability(
totalSpace: (5 * FilesizeMb).MB(),
maxDuration: TimeSpan.FromSeconds(((double)config.Proofs.Period) * 5.0),
minPriceForTotalSpace: 1.TstWei(),
maxCollateral: 999999.Tst())
);
}
return hosts;
2024-11-21 15:10:53 +01:00
}
2024-11-21 10:03:09 +01:00
}
}