Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
rsafier committed Mar 25, 2024
1 parent c9f9311 commit 70abdc3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
18 changes: 9 additions & 9 deletions LNUnit.Tests/Fixture/PostgresLightningFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ namespace LNUnit.Fixtures;
// ReSharper disable once ClassNeverInstantiated.Global
public class PostgresLightningFixture : IDisposable
{
public string DbContainerName { get; set; }= "postgres";
public string DbContainerName { get; set; } = "postgres";
private readonly DockerClient _client = new DockerClientConfiguration().CreateClient();
private string _containerId;
private string _ip;

public PostgresLightningFixture()
{
StartPostgres().Wait();
StartPostgres().Wait();
AddDb("alice");
AddDb("bob");
AddDb("carol");
Expand All @@ -38,7 +38,7 @@ private void AddDb(string dbName)

if (result == null)
{

using var command = new NpgsqlCommand($"CREATE DATABASE \"{dbName}\"", connection);
command.ExecuteNonQuery();
}
Expand All @@ -56,7 +56,7 @@ public void Dispose()
GC.SuppressFinalize(this);

// Remove containers
RemoveContainer(DbContainerName).Wait();
RemoveContainer(DbContainerName).Wait();
RemoveContainer("miner").Wait();
RemoveContainer("alice").Wait();
RemoveContainer("bob").Wait();
Expand All @@ -67,7 +67,7 @@ public void Dispose()
}

public LNUnitBuilder? Builder { get; private set; }


public async Task SetupNetwork()
{
Expand All @@ -88,7 +88,7 @@ public async Task SetupNetwork()
ChannelSize = 10_000_000, //10MSat
RemoteName = "bob"
}
], imageName: "custom_lnd", tagName: "latest", pullImage: false,postgresDSN: LNDConnectionStrings["alice"]);
], imageName: "custom_lnd", tagName: "latest", pullImage: false, postgresDSN: LNDConnectionStrings["alice"]);

Builder.AddPolarLNDNode("bob",
[
Expand All @@ -98,7 +98,7 @@ public async Task SetupNetwork()
RemotePushOnStart = 1_000_000, // 1MSat
RemoteName = "alice"
}
], imageName: "custom_lnd", tagName: "latest", pullImage: false,postgresDSN: LNDConnectionStrings["bob"]);
], imageName: "custom_lnd", tagName: "latest", pullImage: false, postgresDSN: LNDConnectionStrings["bob"]);

Builder.AddPolarLNDNode("carol",
[
Expand All @@ -114,11 +114,11 @@ public async Task SetupNetwork()
RemotePushOnStart = 1_000_000, // 1MSat
RemoteName = "bob"
}
], imageName: "custom_lnd", tagName: "latest", pullImage: false,postgresDSN: LNDConnectionStrings["carol"]);
], imageName: "custom_lnd", tagName: "latest", pullImage: false, postgresDSN: LNDConnectionStrings["carol"]);

await Builder.Build();
}

public async Task StartPostgres()
{
await _client.PullImageAndWaitForCompleted("postgres", "16.2-alpine");
Expand Down
4 changes: 2 additions & 2 deletions LNUnit.Tests/PostgresLightningScenario.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ public PostgresXUnitTest(PostgresLightningFixture fixture, ITestOutputHelper out
Console.SetOut(new TestOutputWriter(output));
}



[Fact]
public async Task Verify_Alice_Bob_Carol_Setup()
{
var readyNodes = _lightningRegtestNetworkFixture.Builder!.LNDNodePool!.ReadyNodes.ToImmutableList();
var nodeCount = readyNodes.Count;
Assert.AreEqual(3, nodeCount);
Assert.That(nodeCount, Is.EqualTo(3));
$"LND Nodes in Ready State: {nodeCount}".Print();
foreach (var node in readyNodes)
{
Expand Down
2 changes: 1 addition & 1 deletion LNUnit/Setup/LNUnitBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ await _dockerClient.Containers.StartContainerAsync(loopServer?.ID,
inspectionResponse = await _dockerClient.Containers.InspectContainerAsync(n.DockerContainerId);
ipAddress = inspectionResponse.NetworkSettings.Networks.First().Value.IPAddress;
}

var basePath = !n.Image.Contains("lightning-terminal") ? "/home/lnd/.lnd" : "/root/lnd/.lnd";
if (n.Image.Contains("lightning-terminal")) await Task.Delay(2000);
var txt = await GetStringFromFS(n.DockerContainerId, $"{basePath}/tls.cert");
Expand Down

0 comments on commit 70abdc3

Please sign in to comment.