mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-18 22:44:29 +01:00
Fix payjoin tests
This commit is contained in:
@@ -152,7 +152,7 @@ namespace BTCPayServer.Controllers
|
|||||||
var cloned = psbt.Clone();
|
var cloned = psbt.Clone();
|
||||||
cloned = cloned.Finalize();
|
cloned = cloned.Finalize();
|
||||||
await _broadcaster.Schedule(DateTimeOffset.UtcNow + TimeSpan.FromMinutes(1.0), cloned.ExtractTransaction(), btcPayNetwork);
|
await _broadcaster.Schedule(DateTimeOffset.UtcNow + TimeSpan.FromMinutes(1.0), cloned.ExtractTransaction(), btcPayNetwork);
|
||||||
return await _payjoinClient.RequestPayjoin(endpoint, derivationSchemeSettings, cloned, cancellationToken);
|
return await _payjoinClient.RequestPayjoin(endpoint, derivationSchemeSettings, psbt, cancellationToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
|
|||||||
@@ -32,6 +32,8 @@ namespace BTCPayServer.Services
|
|||||||
if (endpoint == null) throw new ArgumentNullException(nameof(endpoint));
|
if (endpoint == null) throw new ArgumentNullException(nameof(endpoint));
|
||||||
if (derivationSchemeSettings == null) throw new ArgumentNullException(nameof(derivationSchemeSettings));
|
if (derivationSchemeSettings == null) throw new ArgumentNullException(nameof(derivationSchemeSettings));
|
||||||
if (originalTx == null) throw new ArgumentNullException(nameof(originalTx));
|
if (originalTx == null) throw new ArgumentNullException(nameof(originalTx));
|
||||||
|
if (originalTx.IsAllFinalized())
|
||||||
|
throw new InvalidOperationException("The original PSBT should not be finalized.");
|
||||||
|
|
||||||
var signingAccount = derivationSchemeSettings.GetSigningAccountKeySettings();
|
var signingAccount = derivationSchemeSettings.GetSigningAccountKeySettings();
|
||||||
var sentBefore = -originalTx.GetBalance(derivationSchemeSettings.AccountDerivation,
|
var sentBefore = -originalTx.GetBalance(derivationSchemeSettings.AccountDerivation,
|
||||||
@@ -42,7 +44,7 @@ namespace BTCPayServer.Services
|
|||||||
throw new ArgumentException("originalTx should have utxo information", nameof(originalTx));
|
throw new ArgumentException("originalTx should have utxo information", nameof(originalTx));
|
||||||
var originalFee = originalTx.GetFee();
|
var originalFee = originalTx.GetFee();
|
||||||
var cloned = originalTx.Clone();
|
var cloned = originalTx.Clone();
|
||||||
if (!cloned.IsAllFinalized() && !cloned.TryFinalize(out var errors))
|
if (!cloned.TryFinalize(out var errors))
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user