Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
gruve-p committed Nov 21, 2024
2 parents abf9bcc + 843c813 commit 3c87cf6
Show file tree
Hide file tree
Showing 27 changed files with 718 additions and 1,304 deletions.
4 changes: 2 additions & 2 deletions BTCPayServer.Tests/PayJoinTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -404,10 +404,10 @@ await TestUtils.EventuallyAsync(async () =>
Assert.False(paymentValueRowColumn.Text.Contains("payjoin",
StringComparison.InvariantCultureIgnoreCase));

s.GoToWallet(receiverWalletId, WalletsNavPages.Transactions);
s.Driver.WaitForElement(By.CssSelector("#WalletTransactionsList tr"));
TestUtils.Eventually(() =>
{
s.GoToWallet(receiverWalletId, WalletsNavPages.Transactions);
s.Driver.WaitForElement(By.CssSelector("#WalletTransactionsList tr"));
Assert.Contains("payjoin", s.Driver.PageSource);
// Either the invoice id or the payjoin-exposed label, depending on the input having been used
Assert.Matches(new Regex($"({invoiceId}|payjoin-exposed)"), s.Driver.PageSource);
Expand Down
26 changes: 13 additions & 13 deletions BTCPayServer/Services/DelayedTransactionBroadcaster.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Threading.Tasks;
using BTCPayServer.Data;
using BTCPayServer.Logging;
using Dapper;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
using NBitcoin;
Expand Down Expand Up @@ -45,19 +46,18 @@ public async Task Schedule(DateTimeOffset broadcastTime, Transaction transaction
ArgumentNullException.ThrowIfNull(transaction);
ArgumentNullException.ThrowIfNull(network);
using var db = _dbContextFactory.CreateContext();
db.PlannedTransactions.Add(new PlannedTransaction()
{
Id = $"{network.CryptoCode}-{transaction.GetHash()}",
BroadcastAt = broadcastTime,
Blob = transaction.ToBytes()
});
try
{
await db.SaveChangesAsync();
}
catch (DbUpdateException)
{
}
var conn = db.Database.GetDbConnection();
await conn.ExecuteAsync(
"""
INSERT INTO "PlannedTransactions"("Id", "BroadcastAt", "Blob") VALUES(@Id, @BroadcastAt, @Blob)
ON CONFLICT DO NOTHING
""",
new
{
Id = $"{network.CryptoCode}-{transaction.GetHash()}",
BroadcastAt = broadcastTime,
Blob = transaction.ToBytes()
});
}

public async Task<int> ProcessAll(CancellationToken cancellationToken = default)
Expand Down
43 changes: 32 additions & 11 deletions BTCPayServer/wwwroot/swagger/v1/swagger.template.api-keys.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
"in": "path",
"required": true,
"description": "The API Key to revoke",
"schema": { "type": "string" }
"schema": {
"type": "string"
}
}
],
"responses": {
Expand All @@ -27,7 +29,9 @@
},
"security": [
{
"API_Key": [ "unrestricted" ],
"API_Key": [
"unrestricted"
],
"Basic": []
}
]
Expand All @@ -47,14 +51,18 @@
"in": "path",
"required": true,
"description": "The target user's id or email",
"schema": { "type": "string" }
"schema": {
"type": "string"
}
},
{
"name": "apikey",
"in": "path",
"required": true,
"description": "The API Key to revoke",
"schema": { "type": "string" }
"schema": {
"type": "string"
}
}
],
"responses": {
Expand All @@ -67,7 +75,9 @@
},
"security": [
{
"API_Key": [ "unrestricted" ],
"API_Key": [
"unrestricted"
],
"Basic": []
}
]
Expand Down Expand Up @@ -105,7 +115,9 @@
},
"security": [
{
"API_Key": [ "btcpay.server.canmanageusers" ],
"API_Key": [
"btcpay.server.canmanageusers"
],
"Basic": []
}
]
Expand Down Expand Up @@ -214,7 +226,9 @@
},
"security": [
{
"API_Key": [ "unrestricted" ],
"API_Key": [
"unrestricted"
],
"Basic": []
}
]
Expand All @@ -234,7 +248,9 @@
"in": "path",
"required": true,
"description": "The target user's id or email",
"schema": { "type": "string" }
"schema": {
"type": "string"
}
}
],
"responses": {
Expand Down Expand Up @@ -297,7 +313,9 @@
},
"security": [
{
"API_Key": [ "btcpay.server.canmanageusers" ],
"API_Key": [
"btcpay.server.canmanageusers"
],
"Basic": []
}
]
Expand All @@ -312,7 +330,7 @@
"properties": {
"apiKey": {
"type": "string",
"description": "The API Key to use for API Key Authentication",
"description": "The API Key to use for API Key Authentication",
"nullable": false
},
"label": {
Expand All @@ -327,7 +345,10 @@
"items": {
"type": "string"
},
"example": [ "btcpay.server.canmanageusers", "btcpay.server.canmanageusers:2KxSpc9V5zDWfUbvgYiZuAfka4wUhGF96F75Ao8y4zHP" ]
"example": [
"btcpay.server.canmanageusers",
"btcpay.server.canmanageusers:2KxSpc9V5zDWfUbvgYiZuAfka4wUhGF96F75Ao8y4zHP"
]
}
}
}
Expand Down
Loading

0 comments on commit 3c87cf6

Please sign in to comment.