2
0
mirror of synced 2025-01-13 18:14:14 +00:00
cs-codex-dist-tests/Tools/BiblioTech/BaseGethCommand.cs

32 lines
965 B
C#
Raw Normal View History

2023-10-24 15:25:45 +02:00
using BiblioTech.Options;
using CodexContractsPlugin;
2023-11-02 12:30:48 +01:00
using CodexPlugin;
2023-10-20 10:14:56 +02:00
using Core;
using GethPlugin;
2023-10-20 09:49:23 +02:00
namespace BiblioTech
{
2023-11-02 12:30:48 +01:00
public abstract class BaseGethCommand : BaseDeploymentCommand
2023-10-20 09:49:23 +02:00
{
2023-10-20 10:14:56 +02:00
private readonly CoreInterface ci;
2023-10-20 09:49:23 +02:00
2023-11-02 12:30:48 +01:00
public BaseGethCommand(CoreInterface ci)
2023-10-20 09:49:23 +02:00
{
2023-10-20 10:14:56 +02:00
this.ci = ci;
2023-10-20 09:49:23 +02:00
}
2023-11-02 12:30:48 +01:00
protected override async Task ExecuteDeploymentCommand(CommandContext context, CodexDeployment codexDeployment)
2023-10-20 09:49:23 +02:00
{
2023-10-20 10:14:56 +02:00
var gethDeployment = codexDeployment.GethDeployment;
var contractsDeployment = codexDeployment.CodexContractsDeployment;
var gethNode = ci.WrapGethDeployment(gethDeployment);
2023-10-30 13:30:14 +01:00
var contracts = ci.WrapCodexContractsDeployment(gethNode, contractsDeployment);
2023-10-20 10:14:56 +02:00
2023-10-24 15:25:45 +02:00
await Execute(context, gethNode, contracts);
2023-10-20 09:49:23 +02:00
}
2023-10-24 15:25:45 +02:00
protected abstract Task Execute(CommandContext context, IGethNode gethNode, ICodexContracts contracts);
2023-10-20 09:49:23 +02:00
}
}