From 4d35fd4ab334db5ea329bab1edc61533f7f56461 Mon Sep 17 00:00:00 2001 From: Dennis Reimann Date: Fri, 30 Jul 2021 19:14:47 +0200 Subject: [PATCH] Fix test --- BTCPayServer.Tests/PSBTTests.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/BTCPayServer.Tests/PSBTTests.cs b/BTCPayServer.Tests/PSBTTests.cs index 2c6f7fc4e..50397ebe4 100644 --- a/BTCPayServer.Tests/PSBTTests.cs +++ b/BTCPayServer.Tests/PSBTTests.cs @@ -73,26 +73,26 @@ namespace BTCPayServer.Tests var filePSBT = (FileContentResult)(await walletController.WalletPSBT(walletId, vmPSBT, "save-psbt")); PSBT.Load(filePSBT.FileContents, user.SupportedNetwork.NBitcoinNetwork); - var vmPSBT2 = await walletController.WalletPSBTReady(walletId, new WalletPSBTReadyViewModel() + var vmPSBT2 = await walletController.WalletPSBT(walletId, new WalletPSBTViewModel { - SigningContext = new SigningContextModel() + SigningContext = new SigningContextModel { PSBT = AssertRedirectedPSBT(await walletController.WalletPSBT(walletId, vmPSBT, "broadcast"), nameof(walletController.WalletPSBTReady)) } - }).AssertViewModelAsync(); + }).AssertViewModelAsync(); Assert.NotEmpty(vmPSBT2.Inputs.Where(i => i.Error != null)); Assert.Equal(vmPSBT.PSBT, vmPSBT2.SigningContext.PSBT); var signedPSBT = unsignedPSBT.Clone(); signedPSBT.SignAll(user.DerivationScheme, user.GenerateWalletResponseV.AccountHDKey, user.GenerateWalletResponseV.AccountKeyPath); vmPSBT.PSBT = signedPSBT.ToBase64(); - var psbtReady = await walletController.WalletPSBTReady(walletId, new WalletPSBTReadyViewModel + var psbtReady = await walletController.WalletPSBT(walletId, new WalletPSBTViewModel { SigningContext = new SigningContextModel { PSBT = AssertRedirectedPSBT(await walletController.WalletPSBT(walletId, vmPSBT, "broadcast"), nameof(walletController.WalletPSBTReady)) } - }).AssertViewModelAsync(); + }).AssertViewModelAsync(); 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); @@ -117,10 +117,10 @@ namespace BTCPayServer.Tests Assert.True(signedPSBT2.TryFinalize(out _)); Assert.Equal(signedPSBT, signedPSBT2); - var ready = (await walletController.WalletPSBTReady(walletId, new WalletPSBTReadyViewModel + var ready = (await walletController.WalletPSBT(walletId, new WalletPSBTViewModel { SigningContext = new SigningContextModel(signedPSBT) - })).AssertViewModel(); + })).AssertViewModel(); Assert.Equal(signedPSBT.ToBase64(), ready.SigningContext.PSBT); psbt = AssertRedirectedPSBT(await walletController.WalletPSBTReady(walletId, ready, command: "analyze-psbt"), nameof(walletController.WalletPSBT)); Assert.Equal(signedPSBT.ToBase64(), psbt); @@ -131,7 +131,7 @@ namespace BTCPayServer.Tests Assert.False(string.IsNullOrEmpty(Assert.IsType( Assert.IsType( await walletController.WalletPSBT(walletId, - new WalletPSBTViewModel() + new WalletPSBTViewModel { UploadedPSBTFile = TestUtils.GetFormFile("base64", signedPSBT.ToBase64()) })).Model).PSBT));