Ejemplo n.º 1
0
 public void SendPaymentTest()
 {
     LndClient lndClient = new LndClient();
     // Todo: query a testnet lapp for a payment request
     //var response = lndClient.SendPayment("", 30);
     // Assert.IsNotNull(response);
 }
Ejemplo n.º 2
0
        public void ListPaymentsTest()
        {
            LndClient lndClient = new LndClient();
            var       response  = lndClient.ListPayments();

            Assert.IsNotNull(response);
        }
Ejemplo n.º 3
0
        public void UnlockWalletTestWrongPassword()
        {
            // Arrange
            LndClient lndClient = new LndClient("test_password");

            // Act and Assert
            Assert.ThrowsException <RpcException>(() => lndClient.UnlockWallet("wrong_password"));
        }
Ejemplo n.º 4
0
 public Clients(RPCClient bitcoinRPCClient, LndClient lndClient, CLightningClient cLightningClient, NRustLightningClient nRustLightningHttpClient, NBXplorer.ExplorerClient nbxClient)
 {
     BitcoinRPCClient         = bitcoinRPCClient ?? throw new ArgumentNullException(nameof(bitcoinRPCClient));
     LndClient                = lndClient ?? throw new ArgumentNullException(nameof(lndClient));
     CLightningClient         = cLightningClient ?? throw new ArgumentNullException(nameof(cLightningClient));
     NRustLightningHttpClient = nRustLightningHttpClient ?? throw new ArgumentNullException(nameof(nRustLightningHttpClient));
     NBXClient                = nbxClient ?? throw new ArgumentNullException(nameof(nbxClient));
 }
Ejemplo n.º 5
0
        public void ListChannelsTest()
        {
            // Arrange
            LndClient lndClient = new LndClient();

            // Act
            ListChannelsResponse response = lndClient.ListChannels();

            Assert.IsNotNull(response);
        }
Ejemplo n.º 6
0
        public void NewAddressTest()
        {
            // Arrange
            LndClient lndClient = new LndClient();

            // Act
            NewAddressResponse response = lndClient.NewAddress();

            Assert.IsNotNull(response.Address);
        }
Ejemplo n.º 7
0
        public void GetInfoTest()
        {
            // Arrange
            LndClient lndClient = new LndClient();

            // Act
            GetInfoResponse response = lndClient.GetInfo();

            Assert.AreEqual("0.5.0-beta commit=3b2c807288b1b7f40d609533c1e96a510ac5fa6d", response.Version);
        }
Ejemplo n.º 8
0
        private async Task <LnrpcNetworkInfo> GetNetworkInfoAfterTenfoldWaitingTime(LndClient lndClient, CancellationToken ct)
        {
            if ((DateTime.Now - this.lastNetworkInfoPollingTime).TotalMinutes >= this.configuration.IntervalSeconds)
            {
                this.lastNetworkInfoPollingTime = DateTime.Now;

                return(await lndClient.SwaggerClient.GetNetworkInfoAsync(ct).ConfigureAwait(false));
            }

            return(null);
        }
Ejemplo n.º 9
0
        public LndMockTester(ServerTester serverTester, string environmentName, string defaultValue, string defaultHost, Network network)
        {
            this._Parent = serverTester;
            var url = serverTester.GetEnvironment(environmentName, defaultValue);

            Swagger = new LndSwaggerClient(new LndRestSettings(new Uri(url))
            {
                AllowInsecure = true
            });
            Client  = new LndClient(Swagger, network);
            P2PHost = _Parent.GetEnvironment(environmentName + "_HOST", defaultHost);
        }
Ejemplo n.º 10
0
        public void UnlockWalletTestRightPassword()
        {
            // Arrange
            LndClient lndClient = new LndClient("test_password");

            // Act and Assert
            try
            {
                UnlockWalletResponse response = lndClient.UnlockWallet("test_password");
            }
            catch (RpcException e)
            {
                // Wallet is already unlocked
                Assert.AreEqual("unknown service lnrpc.WalletUnlocker", e.Status.Detail);
            }
        }
Ejemplo n.º 11
0
 public void Setup()
 {
     LndClient = new LndClient();
     LndClient.Config.Network = "testnet";
 }
Ejemplo n.º 12
0
 public NodeAliasCache(LndClient client)
 {
     this.client         = client;
     this.nodeAliasCache = new Dictionary <string, string>();
 }
Ejemplo n.º 13
0
 public AsyncLightningApp(ThisAddIn excelAddIn)
 {
     _excelAddIn = excelAddIn;
     LndClient   = new LndClient();
 }