Esempio n. 1
0
        private async Task WaitServersAreUp(string name, ILightningClient client)
        {
            var rpc = Tester.CreateRPC();
            await rpc.ScanRPCCapabilitiesAsync();

            await rpc.GenerateAsync(1);

            Exception realException = null;

            using (var cts = new CancellationTokenSource(TimeSpan.FromSeconds(Timeout - 5)))
            {
retry:
                try
                {
                    if (realException != null)
                    {
                        await Task.Delay(1000, cts.Token);
                    }
                    await client.GetInfo(cts.Token);

                    Logs.Tester.LogInformation($"{name}: Server is up");
                }
                catch (Exception ex) when(!cts.IsCancellationRequested)
                {
                    realException = ex;
                    goto retry;
                }
                catch (Exception)
                {
                    Logs.Tester.LogInformation(realException.ToString());
                    Assert.False(true, $"{name}: The server could not be started");
                }
            }
        }
Esempio n. 2
0
        public async Task CanGetInfo()
        {
            var blockHeight = Tester.CreateRPC().GetBlockCount();

            foreach (var client in Tester.GetLightningClients())
            {
                Logs.Tester.LogInformation($"{client.Name}: {nameof(CanGetInfo)}");
                var info = await client.Client.GetInfo();

                Assert.NotNull(info);
                Assert.Equal(blockHeight, info.BlockHeight);
                Assert.NotEmpty(info.NodeInfoList);
            }
        }
Esempio n. 3
0
        public async Task CanGetInfo()
        {
            await EnsureConnectedToDestinations();

            var blockHeight = Tester.CreateRPC().GetBlockCount();

            foreach (var client in Tester.GetLightningClients())
            {
                var info = await client.GetInfo();

                Assert.NotNull(info);
                Assert.Equal(blockHeight, info.BlockHeight);
                Assert.NotNull(info.NodeInfo);
            }
        }