This commit is contained in:
Kukks 2020-09-16 11:49:47 +02:00
parent 8e8415515d
commit 9365706777

View File

@ -1459,6 +1459,35 @@ namespace BTCPayServer.Tests
);
}
}
// [Fact(Timeout = TestTimeout)]
[Fact()]
[Trait("Integration", "Integration")]
public async Task CanSaveKeyPathForOnChainPayments()
{
using var tester = ServerTester.Create();
await tester.StartAsync();
var user = tester.NewAccount();
await user.GrantAccessAsync();
await user.RegisterDerivationSchemeAsync("BTC");
var invoice = await user.BitPay.CreateInvoiceAsync(new Invoice(0.01m, "BTC"));
await tester.WaitForEvent<InvoiceEvent>(async () =>
{
var tx = await tester.ExplorerNode.SendToAddressAsync(
BitcoinAddress.Create(invoice.BitcoinAddress, Network.RegTest),
Money.Coins(0.01m));
});
var payments = Assert.IsType<InvoiceDetailsModel>(
Assert.IsType<ViewResult>(await user.GetController<InvoiceController>().Invoice(invoice.Id)).Model)
.Payments;
Assert.Single(payments);
var paymentData = payments.First().GetCryptoPaymentData() as BitcoinLikePaymentData;
Assert.NotNull(paymentData.KeyPath);
}
[Fact(Timeout = TestTimeout)]
[Trait("Fast", "Fast")]