2023-04-14 07:54:07 +00:00
|
|
|
|
using KubernetesWorkflow;
|
2023-04-24 12:09:23 +00:00
|
|
|
|
using NethereumWorkflow;
|
2023-04-14 07:54:07 +00:00
|
|
|
|
|
|
|
|
|
namespace DistTestCore.Marketplace
|
|
|
|
|
{
|
|
|
|
|
public class GethCompanionNodeInfo
|
|
|
|
|
{
|
2023-05-03 08:21:15 +00:00
|
|
|
|
public GethCompanionNodeInfo(RunningContainer runningContainer, GethAccount[] accounts)
|
2023-04-14 07:54:07 +00:00
|
|
|
|
{
|
|
|
|
|
RunningContainer = runningContainer;
|
2023-04-26 09:12:33 +00:00
|
|
|
|
Accounts = accounts;
|
2023-04-14 07:54:07 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public RunningContainer RunningContainer { get; }
|
2023-05-03 08:21:15 +00:00
|
|
|
|
public GethAccount[] Accounts { get; }
|
2023-04-26 09:12:33 +00:00
|
|
|
|
|
2023-06-01 13:56:26 +00:00
|
|
|
|
public NethereumInteraction StartInteraction(TestLifecycle lifecycle, GethAccount account)
|
2023-04-24 12:09:23 +00:00
|
|
|
|
{
|
2023-06-01 13:56:26 +00:00
|
|
|
|
var address = lifecycle.Configuration.GetAddress(RunningContainer);
|
2023-04-26 09:12:33 +00:00
|
|
|
|
var privateKey = account.PrivateKey;
|
2023-04-24 12:09:23 +00:00
|
|
|
|
|
2023-06-01 13:56:26 +00:00
|
|
|
|
var creator = new NethereumInteractionCreator(lifecycle.Log, address.Host, address.Port, privateKey);
|
2023-04-24 12:09:23 +00:00
|
|
|
|
return creator.CreateWorkflow();
|
|
|
|
|
}
|
2023-04-14 07:54:07 +00:00
|
|
|
|
}
|
2023-04-26 09:12:33 +00:00
|
|
|
|
|
2023-05-03 08:21:15 +00:00
|
|
|
|
public class GethAccount
|
2023-04-26 09:12:33 +00:00
|
|
|
|
{
|
2023-05-03 08:21:15 +00:00
|
|
|
|
public GethAccount(string account, string privateKey)
|
2023-04-26 09:12:33 +00:00
|
|
|
|
{
|
|
|
|
|
Account = account;
|
|
|
|
|
PrivateKey = privateKey;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public string Account { get; }
|
|
|
|
|
public string PrivateKey { get; }
|
|
|
|
|
}
|
2023-04-14 07:54:07 +00:00
|
|
|
|
}
|