mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-01-19 05:33:31 +01:00
Add test
This commit is contained in:
parent
8e8415515d
commit
9365706777
@ -1460,6 +1460,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")]
|
||||
public void CanParseFilter()
|
||||
|
Loading…
Reference in New Issue
Block a user