cs-codex-dist-tests/DistTestCore/Marketplace/GethBootstrapNodeInfo.cs

43 lines
1.3 KiB
C#
Raw Normal View History

2023-04-14 07:54:07 +00:00
using KubernetesWorkflow;
using NethereumWorkflow;
2023-04-14 07:54:07 +00:00
namespace DistTestCore.Marketplace
{
public class GethBootstrapNodeInfo
{
2023-05-03 08:21:15 +00:00
public GethBootstrapNodeInfo(RunningContainers runningContainers, AllGethAccounts allAccounts, string pubKey, Port discoveryPort)
2023-04-14 07:54:07 +00:00
{
RunningContainers = runningContainers;
2023-05-03 08:21:15 +00:00
AllAccounts = allAccounts;
Account = allAccounts.Accounts[0];
PubKey = pubKey;
DiscoveryPort = discoveryPort;
2023-04-14 07:54:07 +00:00
}
public RunningContainers RunningContainers { get; }
2023-05-03 08:21:15 +00:00
public AllGethAccounts AllAccounts { get; }
public GethAccount Account { get; }
public string PubKey { get; }
public Port DiscoveryPort { get; }
public NethereumInteraction StartInteraction(TestLifecycle lifecycle)
{
var address = lifecycle.Configuration.GetAddress(RunningContainers.Containers[0]);
var account = Account;
var creator = new NethereumInteractionCreator(lifecycle.Log, address.Host, address.Port, account.PrivateKey);
return creator.CreateWorkflow();
}
2023-04-14 07:54:07 +00:00
}
2023-05-03 08:21:15 +00:00
public class AllGethAccounts
{
public GethAccount[] Accounts { get; }
public AllGethAccounts(GethAccount[] accounts)
{
Accounts = accounts;
}
}
2023-04-14 07:54:07 +00:00
}