Adds IHasContainer to geth objects.

This commit is contained in:
benbierens 2023-09-21 10:56:48 +02:00
parent 2f81927bef
commit e4716b5471
No known key found for this signature in database
GPG Key ID: FE44815D96D0A1AA
4 changed files with 13 additions and 9 deletions

View File

@ -16,7 +16,7 @@ namespace CodexContractsPlugin
{
var config = startupConfig.Get<CodexContractsContainerConfig>();
var ip = config.GethNode.StartResult.RunningContainer.Pod.PodInfo.Ip;
var ip = config.GethNode.StartResult.Container.Pod.PodInfo.Ip;
var port = config.GethNode.StartResult.HttpPort.Number;
AddEnvVar("DISTTEST_NETWORK_URL", $"http://{ip}:{port}");

View File

@ -81,7 +81,7 @@ namespace CodexPlugin
{
var mconfig = config.MarketplaceConfig;
var gethStart = mconfig.GethNode.StartResult;
var ip = gethStart.RunningContainer.Pod.PodInfo.Ip;
var ip = gethStart.Container.Pod.PodInfo.Ip;
var port = gethStart.WsPort.Number;
var marketplaceAddress = mconfig.CodexContracts.Deployment.MarketplaceAddress;

View File

@ -1,12 +1,13 @@
using KubernetesWorkflow;
using Core;
using KubernetesWorkflow;
namespace GethPlugin
{
public class GethDeployment
public class GethDeployment : IHasContainer
{
public GethDeployment(RunningContainer runningContainer, Port discoveryPort, Port httpPort, Port wsPort, AllGethAccounts allAccounts, string pubKey)
{
RunningContainer = runningContainer;
Container = runningContainer;
DiscoveryPort = discoveryPort;
HttpPort = httpPort;
WsPort = wsPort;
@ -14,7 +15,7 @@ namespace GethPlugin
PubKey = pubKey;
}
public RunningContainer RunningContainer { get; }
public RunningContainer Container { get; }
public Port DiscoveryPort { get; }
public Port HttpPort { get; }
public Port WsPort { get; }

View File

@ -1,10 +1,12 @@
using Logging;
using Core;
using KubernetesWorkflow;
using Logging;
using Nethereum.Contracts;
using NethereumWorkflow;
namespace GethPlugin
{
public interface IGethNode
public interface IGethNode : IHasContainer
{
GethDeployment StartResult { get; }
@ -32,6 +34,7 @@ namespace GethPlugin
public GethDeployment StartResult { get; }
public GethAccount Account { get; }
public RunningContainer Container => StartResult.Container;
public Ether GetEthBalance()
{
@ -70,7 +73,7 @@ namespace GethPlugin
private NethereumInteraction StartInteraction()
{
var address = StartResult.RunningContainer.Address;
var address = StartResult.Container.Address;
var account = Account;
var creator = new NethereumInteractionCreator(log, address.Host, address.Port, account.PrivateKey);