mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2026-02-18 12:44:22 +01:00
Fix: Setup a boltcard for the second time wouldn't generate new keys
This commit is contained in:
@@ -2189,6 +2189,10 @@ namespace BTCPayServer.Tests
|
||||
// Relink should bump Version
|
||||
reg = await db.GetBoltcardRegistration(issuerKey, uid);
|
||||
Assert.Equal((ppid, 0, 1), (reg.PullPaymentId, reg.Counter, reg.Version));
|
||||
|
||||
await db.LinkBoltcardToPullPayment(ppid, issuerKey, uid);
|
||||
reg = await db.GetBoltcardRegistration(issuerKey, uid);
|
||||
Assert.Equal((ppid, 0, 2), (reg.PullPaymentId, reg.Counter, reg.Version));
|
||||
}
|
||||
|
||||
s.GoToStore(s.StoreId, StoreNavPages.PullPayments);
|
||||
|
||||
@@ -21,7 +21,7 @@ public static class BoltcardDataExtensions
|
||||
string onConflict = onExisting switch
|
||||
{
|
||||
OnExistingBehavior.KeepVersion => "UPDATE SET ppid=excluded.ppid, version=boltcards.version",
|
||||
OnExistingBehavior.UpdateVersion => "UPDATE SET ppid=excluded.ppid, version=excluded.version+1",
|
||||
OnExistingBehavior.UpdateVersion => "UPDATE SET ppid=excluded.ppid, version=boltcards.version+1",
|
||||
_ => throw new NotSupportedException()
|
||||
};
|
||||
return await conn.QueryFirstOrDefaultAsync<int>(
|
||||
|
||||
Reference in New Issue
Block a user