コード例 #1
0
ファイル: TestAccount.cs プロジェクト: viacoin/btcpayserver
        public async Task RegisterLightningNodeAsync(string cryptoCode, LightningConnectionType connectionType)
        {
            var storeController = this.GetController <StoresController>();

            string connectionString = null;

            if (connectionType == LightningConnectionType.Charge)
            {
                connectionString = "type=charge;server=" + parent.MerchantCharge.Client.Uri.AbsoluteUri;
            }
            else if (connectionType == LightningConnectionType.CLightning)
            {
                connectionString = "type=clightning;server=" + parent.MerchantLightningD.Address.AbsoluteUri;
            }
            else if (connectionType == LightningConnectionType.LndREST)
            {
                connectionString = $"type=lnd-rest;server={parent.MerchantLnd.Swagger.BaseUrl};allowinsecure=true";
            }
            else
            {
                throw new NotSupportedException(connectionType.ToString());
            }

            await storeController.AddLightningNode(StoreId, new LightningNodeViewModel()
            {
                ConnectionString = connectionString,
                SkipPortTest     = true
            }, "save", "BTC");

            if (storeController.ModelState.ErrorCount != 0)
            {
                Assert.False(true, storeController.ModelState.FirstOrDefault().Value.Errors[0].ErrorMessage);
            }
        }
コード例 #2
0
        public void AddLightningNode(string cryptoCode, LightningConnectionType connectionType)
        {
            string connectionString = null;

            if (connectionType == LightningConnectionType.Charge)
            {
                connectionString = "type=charge;server=" + Server.MerchantCharge.Client.Uri.AbsoluteUri;
            }
            else if (connectionType == LightningConnectionType.CLightning)
            {
                connectionString = "type=clightning;server=" + ((CLightningClient)Server.MerchantLightningD).Address.AbsoluteUri;
            }
            else if (connectionType == LightningConnectionType.LndREST)
            {
                connectionString = $"type=lnd-rest;server={Server.MerchantLnd.Swagger.BaseUrl};allowinsecure=true";
            }
            else
            {
                throw new NotSupportedException(connectionType.ToString());
            }

            Driver.FindElement(By.Id($"Modify-Lightning{cryptoCode}")).ForceClick();
            Driver.FindElement(By.Name($"ConnectionString")).SendKeys(connectionString);
            Driver.FindElement(By.Id($"save")).ForceClick();
        }
コード例 #3
0
 public async Task RegisterLightningNodeAsync(string cryptoCode, LightningConnectionType connectionType)
 {
     var storeController = parent.PayTester.GetController <StoresController>(UserId);
     await storeController.AddLightningNode(StoreId, new LightningNodeViewModel()
     {
         Url = connectionType == LightningConnectionType.Charge ? parent.MerchantCharge.Client.Uri.AbsoluteUri :
               connectionType == LightningConnectionType.CLightning ? parent.MerchantLightningD.Address.AbsoluteUri
               : throw new NotSupportedException(connectionType.ToString())
     }, "save", "BTC");