mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-17 22:14:26 +01:00
This commit is contained in:
@@ -161,7 +161,7 @@ public class MultisigTests : UnitTestBase
|
|||||||
await s.Page.ClickAsync("#PSBTOptionsImportHeader");
|
await s.Page.ClickAsync("#PSBTOptionsImportHeader");
|
||||||
await s.Page.FillAsync("#ImportedPSBT", signedPsbt);
|
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)
|
private GenerateWalletResponse generateWalletResp(string tpriv, string keypath, string derivation, BTCPayNetwork network)
|
||||||
|
|||||||
@@ -172,22 +172,16 @@ namespace BTCPayServer.Controllers
|
|||||||
return RedirectToAction(nameof(WalletTransactions), new { walletId = walletId.ToString() });
|
return RedirectToAction(nameof(WalletTransactions), new { walletId = walletId.ToString() });
|
||||||
case "sign":
|
case "sign":
|
||||||
return await WalletSign(walletId, vm);
|
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":
|
case "decode":
|
||||||
ModelState.Remove(nameof(vm.PSBT));
|
ModelState.Remove(nameof(vm.PSBT));
|
||||||
ModelState.Remove(nameof(vm.FileName));
|
ModelState.Remove(nameof(vm.FileName));
|
||||||
ModelState.Remove(nameof(vm.UploadedPSBTFile));
|
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);
|
await FetchTransactionDetails(walletId, derivationSchemeSettings, vm, network);
|
||||||
return View("WalletPSBTDecoded", vm);
|
return View("WalletPSBTDecoded", vm);
|
||||||
|
|
||||||
|
|||||||
@@ -92,7 +92,14 @@
|
|||||||
<input asp-for="UploadedPSBTFile" type="file" class="form-control">
|
<input asp-for="UploadedPSBTFile" type="file" class="form-control">
|
||||||
</div>
|
</div>
|
||||||
<div class="d-flex">
|
<div class="d-flex">
|
||||||
<button type="submit" name="command" value="decode" class="btn btn-primary mt-2" id="Decode" text-translate="true">Decode PSBT</button>
|
@if (this.Model.SigningContext.PendingTransactionId is not null)
|
||||||
|
{
|
||||||
|
<button type="submit" name="command" value="collect" class="btn btn-primary mt-2" id="Collect" text-translate="true">Collect signatures</button>
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
<button type="submit" name="command" value="decode" class="btn btn-primary mt-2" id="Decode" text-translate="true">Decode PSBT</button>
|
||||||
|
}
|
||||||
<button type="button" id="scanqrcode" class="btn btn-secondary only-for-js ms-3 mt-2" data-bs-toggle="modal" data-bs-target="#scanModal" text-translate="true">Scan wallet QR with camera</button>
|
<button type="button" id="scanqrcode" class="btn btn-secondary only-for-js ms-3 mt-2" data-bs-toggle="modal" data-bs-target="#scanModal" text-translate="true">Scan wallet QR with camera</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
@@ -213,7 +213,14 @@ else
|
|||||||
<input asp-for="UploadedPSBTFile" type="file" class="form-control">
|
<input asp-for="UploadedPSBTFile" type="file" class="form-control">
|
||||||
</div>
|
</div>
|
||||||
<div class="d-flex flex-column flex-sm-row flex-wrap align-items-sm-center">
|
<div class="d-flex flex-column flex-sm-row flex-wrap align-items-sm-center">
|
||||||
<button type="submit" name="command" value="decode" class="btn btn-primary mb-3 mb-sm-0 me-sm-2" id="Decode" text-translate="true">Decode PSBT</button>
|
@if (this.Model.SigningContext.PendingTransactionId is not null)
|
||||||
|
{
|
||||||
|
<button type="submit" name="command" value="collect" class="btn btn-primary mb-3 mb-sm-0 me-sm-2" id="Collect" text-translate="true">Collect signatures</button>
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
<button type="submit" name="command" value="decode" class="btn btn-primary mb-3 mb-sm-0 me-sm-2" id="Decode" text-translate="true">Decode PSBT</button>
|
||||||
|
}
|
||||||
<button type="button" id="scanqrcode" class="btn btn-primary only-for-js" data-bs-toggle="modal" data-bs-target="#scanModal" text-translate="true">Scan wallet QR with camera</button>
|
<button type="button" id="scanqrcode" class="btn btn-primary only-for-js" data-bs-toggle="modal" data-bs-target="#scanModal" text-translate="true">Scan wallet QR with camera</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
Reference in New Issue
Block a user