Fix tests

This commit is contained in:
nicolas.dorier
2019-05-20 00:06:03 +09:00
parent 9b6b9e6113
commit 39157e6883
2 changed files with 3 additions and 4 deletions

View File

@@ -73,16 +73,15 @@ namespace BTCPayServer.Tests
PSBT.Load(filePSBT.FileContents, user.SupportedNetwork.NBitcoinNetwork);
await walletController.WalletPSBT(walletId, vmPSBT, "ledger").AssertViewModelAsync<WalletSendLedgerModel>();
var vmPSBT2 = await walletController.WalletPSBT(walletId, vmPSBT, "broadcast").AssertViewModelAsync<WalletPSBTViewModel>();
var vmPSBT2 = await walletController.WalletPSBT(walletId, vmPSBT, "broadcast").AssertViewModelAsync<WalletPSBTReadyViewModel>();
Assert.NotEmpty(vmPSBT2.Errors);
Assert.Equal(vmPSBT.Decoded, vmPSBT2.Decoded);
Assert.Equal(vmPSBT.PSBT, vmPSBT2.PSBT);
var signedPSBT = unsignedPSBT.Clone();
signedPSBT.SignAll(user.DerivationScheme, user.ExtKey);
vmPSBT.PSBT = signedPSBT.ToBase64();
var psbtReady = await walletController.WalletPSBT(walletId, vmPSBT, "broadcast").AssertViewModelAsync<WalletPSBTReadyViewModel>();
Assert.Equal(2, psbtReady.Destinations.Count);
Assert.Equal(2 + 1, psbtReady.Destinations.Count); // The fee is a destination
Assert.Contains(psbtReady.Destinations, d => d.Destination == sendDestination && !d.Positive);
Assert.Contains(psbtReady.Destinations, d => d.Positive);
var redirect = Assert.IsType<RedirectToActionResult>(await walletController.WalletPSBTReady(walletId, psbtReady, command: "broadcast"));

View File

@@ -38,7 +38,7 @@
<button name="command" type="submit" class="dropdown-item" value="seed">... an HD private key or mnemonic seed</button>
<button name="command" type="submit" class="dropdown-item" value="save-psbt">... a wallet supporting PSBT (save as file)</button>
</div>
<button name="command" type="submit" class="btn btn-secondary" value="broadcast">Broadcast</button>
<button name="command" type="submit" class="btn btn-secondary" value="broadcast">Review</button>
<button name="command" type="submit" class="btn btn-secondary" value="combine">Combine with another PSBT</button>
</div>
</form>