diff --git a/BTCPayServer.Tests/FeatureTests/MultisigTests.cs b/BTCPayServer.Tests/FeatureTests/MultisigTests.cs index 80fa3fbcb..48b8607c7 100644 --- a/BTCPayServer.Tests/FeatureTests/MultisigTests.cs +++ b/BTCPayServer.Tests/FeatureTests/MultisigTests.cs @@ -161,7 +161,7 @@ public class MultisigTests : UnitTestBase await s.Page.ClickAsync("#PSBTOptionsImportHeader"); await s.Page.FillAsync("#ImportedPSBT", signedPsbt); - await s.Page.ClickAsync("#Decode"); + await s.Page.ClickAsync("#Collect"); } private GenerateWalletResponse generateWalletResp(string tpriv, string keypath, string derivation, BTCPayNetwork network) diff --git a/BTCPayServer/Controllers/UIWalletsController.PSBT.cs b/BTCPayServer/Controllers/UIWalletsController.PSBT.cs index fa5c32762..394513d12 100644 --- a/BTCPayServer/Controllers/UIWalletsController.PSBT.cs +++ b/BTCPayServer/Controllers/UIWalletsController.PSBT.cs @@ -172,22 +172,16 @@ namespace BTCPayServer.Controllers return RedirectToAction(nameof(WalletTransactions), new { walletId = walletId.ToString() }); case "sign": return await WalletSign(walletId, vm); + case "collect" when vm.SigningContext.PendingTransactionId is not null: + return await RedirectToWalletPSBTReady(walletId, + new WalletPSBTReadyViewModel + { + SigningContext = vm.SigningContext, ReturnUrl = vm.ReturnUrl, BackUrl = vm.BackUrl + }); case "decode": ModelState.Remove(nameof(vm.PSBT)); ModelState.Remove(nameof(vm.FileName)); ModelState.Remove(nameof(vm.UploadedPSBTFile)); - - // for pending transactions we collect signature from PSBT and redirect if everything is good - if (vm.SigningContext.PendingTransactionId is not null) - { - return await RedirectToWalletPSBTReady(walletId, - new WalletPSBTReadyViewModel - { - SigningContext = vm.SigningContext, ReturnUrl = vm.ReturnUrl, BackUrl = vm.BackUrl - }); - } - - // for regular transactions we decode PSBT and show the details await FetchTransactionDetails(walletId, derivationSchemeSettings, vm, network); return View("WalletPSBTDecoded", vm); diff --git a/BTCPayServer/Views/UIWallets/WalletPSBT.cshtml b/BTCPayServer/Views/UIWallets/WalletPSBT.cshtml index ebe03c14a..062692e4b 100644 --- a/BTCPayServer/Views/UIWallets/WalletPSBT.cshtml +++ b/BTCPayServer/Views/UIWallets/WalletPSBT.cshtml @@ -92,7 +92,14 @@
- + @if (this.Model.SigningContext.PendingTransactionId is not null) + { + + } + else + { + + }
diff --git a/BTCPayServer/Views/UIWallets/WalletPSBTDecoded.cshtml b/BTCPayServer/Views/UIWallets/WalletPSBTDecoded.cshtml index 2c310e490..27389998f 100644 --- a/BTCPayServer/Views/UIWallets/WalletPSBTDecoded.cshtml +++ b/BTCPayServer/Views/UIWallets/WalletPSBTDecoded.cshtml @@ -213,7 +213,14 @@ else
- + @if (this.Model.SigningContext.PendingTransactionId is not null) + { + + } + else + { + + }