2018-08-30 04:50:39 +02:00
|
|
|
using BTCPayServer.Lightning;
|
|
|
|
using BTCPayServer.Lightning.Charge;
|
2018-02-23 07:21:42 +01:00
|
|
|
using NBitcoin;
|
|
|
|
|
|
|
|
namespace BTCPayServer.Tests
|
|
|
|
{
|
|
|
|
public class ChargeTester
|
|
|
|
{
|
2020-06-29 05:07:48 +02:00
|
|
|
private readonly ServerTester _Parent;
|
2018-02-23 07:21:42 +01:00
|
|
|
|
|
|
|
public ChargeTester(ServerTester serverTester, string environmentName, string defaultValue, string defaultHost, Network network)
|
|
|
|
{
|
|
|
|
this._Parent = serverTester;
|
|
|
|
var url = serverTester.GetEnvironment(environmentName, defaultValue);
|
2023-11-21 10:55:02 +01:00
|
|
|
|
|
|
|
Client = (ChargeClient)new LightningClientFactory(network).Create(url);
|
2018-02-23 07:21:42 +01:00
|
|
|
P2PHost = _Parent.GetEnvironment(environmentName + "_HOST", defaultHost);
|
2020-06-28 10:55:27 +02:00
|
|
|
}
|
2018-02-23 07:21:42 +01:00
|
|
|
public ChargeClient Client { get; set; }
|
|
|
|
public string P2PHost { get; }
|
|
|
|
}
|
|
|
|
}
|