Skip to content

Commit

Permalink
must be in same namespace or fixture won't run.
Browse files Browse the repository at this point in the history
  • Loading branch information
rsafier committed Mar 26, 2024
1 parent 3665af8 commit 3e78264
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
3 changes: 2 additions & 1 deletion LNUnit.Tests/AbcLightningFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
using ServiceStack.Text;
using Assert = NUnit.Framework.Assert;

namespace LNUnit.Fixtures;

[TestFixture("postgres")]
[TestFixture("boltdb")]
Expand Down Expand Up @@ -75,13 +76,13 @@ public void Dispose()
GC.SuppressFinalize(this);

// Remove containers
_client.RemoveContainer(DbContainerName).Wait();
_client.RemoveContainer("miner").Wait();
_client.RemoveContainer("alice").Wait();
_client.RemoveContainer("bob").Wait();
_client.RemoveContainer("carol").Wait();

Builder?.Destroy();
Builder?.Dispose();
_client.Dispose();
}

Expand Down
9 changes: 5 additions & 4 deletions LNUnit/Setup/LNUnitBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class LNUnitBuilder : IDisposable
private readonly ILogger<LNUnitBuilder>? _logger;
private readonly IServiceProvider? _serviceProvider;
private bool _loopLNDReady;
private int _waitForBitcoinNodeStartup = 30_000; //ms timeout
public int WaitForBitcoinNodeStartupTimeout { get; set; } = 30_000; //ms timeout
public Dictionary<string, LNDChannelInterceptorHandler> ChannelHandlers = new();

public Dictionary<string, LNDSimpleHtlcInterceptorHandler> InterceptorHandlers = new();
Expand Down Expand Up @@ -136,8 +136,9 @@ public async Task Build(bool setupNetwork = false, string lndRoot = "/home/lnd/.
bitcoinNode = listContainers.First(x => x.ID == nodeContainer.ID);
BitcoinRpcClient = new RPCClient("bitcoin:bitcoin",
bitcoinNode.NetworkSettings.Networks.First().Value.IPAddress, Bitcoin.Instance.Regtest);
_waitForBitcoinNodeStartup = 10000;
BitcoinRpcClient.HttpClient.Timeout = TimeSpan.FromMilliseconds(_waitForBitcoinNodeStartup); //10s
WaitForBitcoinNodeStartupTimeout = 30000;
BitcoinRpcClient.HttpClient = new HttpClient() { Timeout = WaitForBitcoinNodeStartupTimeout };

Check failure on line 140 in LNUnit/Setup/LNUnitBuilder.cs

View workflow job for this annotation

GitHub Actions / build

Cannot implicitly convert type 'int' to 'System.TimeSpan'

Check failure on line 140 in LNUnit/Setup/LNUnitBuilder.cs

View workflow job for this annotation

GitHub Actions / build

Cannot implicitly convert type 'int' to 'System.TimeSpan'

Check failure on line 140 in LNUnit/Setup/LNUnitBuilder.cs

View workflow job for this annotation

GitHub Actions / build

Cannot implicitly convert type 'int' to 'System.TimeSpan'

Check failure on line 140 in LNUnit/Setup/LNUnitBuilder.cs

View workflow job for this annotation

GitHub Actions / build

Cannot implicitly convert type 'int' to 'System.TimeSpan'

await BitcoinRpcClient.CreateWalletAsync("default", new CreateWalletOptions { LoadOnStartup = true });
var utxos = await BitcoinRpcClient.GenerateAsync(200);
}
Expand Down Expand Up @@ -838,7 +839,7 @@ public static LNUnitBuilder AddPolarLNDNode(this LNUnitBuilder b, string aliasHo
List<LNUnitNetworkDefinition.Channel>? channels = null, string bitcoinMinerHost = "miner",
string rpcUser = "bitcoin", string rpcPass = "bitcoin", string imageName = "polarlightning/lnd",
string tagName = "0.17.4-beta", bool acceptKeysend = true, bool pullImage = true, bool mapTotmp = false,
bool gcInvoiceOnStartup = false, bool gcInvoiceOnFly = false, string postgresDSN = null)
bool gcInvoiceOnStartup = false, bool gcInvoiceOnFly = false, string? postgresDSN = null)
{
var cmd = new List<string>
{
Expand Down

0 comments on commit 3e78264

Please sign in to comment.