cs-codex-dist-tests/Tools/BiblioTech/BaseGethCommand.cs

32 lines
965 B
C#
Raw Normal View History

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