Fix payjoin tests

This commit is contained in:
nicolas.dorier 2020-04-08 18:24:04 +09:00
parent b1cc30d25d
commit b203d369fb
No known key found for this signature in database
GPG key ID: 6618763EF09186FE
2 changed files with 4 additions and 2 deletions

View file

@ -152,7 +152,7 @@ namespace BTCPayServer.Controllers
var cloned = psbt.Clone();
cloned = cloned.Finalize();
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]

View file

@ -32,6 +32,8 @@ namespace BTCPayServer.Services
if (endpoint == null) throw new ArgumentNullException(nameof(endpoint));
if (derivationSchemeSettings == null) throw new ArgumentNullException(nameof(derivationSchemeSettings));
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 sentBefore = -originalTx.GetBalance(derivationSchemeSettings.AccountDerivation,
@ -42,7 +44,7 @@ namespace BTCPayServer.Services
throw new ArgumentException("originalTx should have utxo information", nameof(originalTx));
var originalFee = originalTx.GetFee();
var cloned = originalTx.Clone();
if (!cloned.IsAllFinalized() && !cloned.TryFinalize(out var errors))
if (!cloned.TryFinalize(out var errors))
{
return null;
}