remove bitcoinstore ref in BuildTxnResult and pass it to TDVM instead.
MODIFY
WalletWasabi.Gui/Controls/TransactionDetails/ViewModels/TransactionDetailsViewModel.cs
WalletWasabi.Gui/Controls/TransactionDetails/ViewModels/TransactionDetailsViewModel.cs
@@ -5,6 +5,7 @@ using NBitcoin;
using ReactiveUI;
using WalletWasabi.Blockchain.TransactionBuilding;
using WalletWasabi.Gui.Controls.TransactionDetails.Models;
+using WalletWasabi.Stores;
namespace WalletWasabi.Gui.Controls.TransactionDetails.ViewModels
{
@@ -88,13 +89,13 @@ namespace WalletWasabi.Gui.Controls.TransactionDetails.ViewModels
set => this.RaiseAndSetIfChanged(ref _outputCount, value);
}
- public static TransactionDetailsViewModel FromBuildTxnResult(BuildTransactionResult result)
+ public static TransactionDetailsViewModel FromBuildTxnResult(BitcoinStore stores, BuildTransactionResult result)
{
AddressAmountTuple FromTxOutput(TxOut output) =>
new AddressAmountTuple(output.ScriptPubKey.GetDestinationAddress(result.Network).ToString(), output.Value);
TxOut GetOutput(OutPoint outpoint) =>
- result.Store.TransactionStore.TryGetTransaction(outpoint.Hash, out var prevTxn)
+ stores.TransactionStore.TryGetTransaction(outpoint.Hash, out var prevTxn)
? prevTxn.Transaction.Outputs[outpoint.N]
: null;

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/TransactionViewerViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/TransactionViewerViewModel.cs
@@ -149,7 +149,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
{
try
{
- TransactionDetails = TransactionDetailsViewModel.FromBuildTxnResult(result);
+ TransactionDetails = TransactionDetailsViewModel.FromBuildTxnResult(Global.BitcoinStore, result);
TransactionHexText = result.Transaction.Transaction.ToHex();
PsbtBase64Text = result.Psbt.ToBase64();
PsbtBytes = result.Psbt.ToBytes();

MODIFY
WalletWasabi/Blockchain/TransactionBuilding/BuildTransactionResult.cs
WalletWasabi/Blockchain/TransactionBuilding/BuildTransactionResult.cs
@@ -3,15 +3,13 @@ using System.Collections.Generic;
using WalletWasabi.Blockchain.TransactionOutputs;
using WalletWasabi.Blockchain.Transactions;
using WalletWasabi.Helpers;
-using WalletWasabi.Stores;
namespace WalletWasabi.Blockchain.TransactionBuilding
{
public class BuildTransactionResult
{
- public BuildTransactionResult(BitcoinStore store, Network network, SmartTransaction transaction, PSBT psbt, bool spendsUnconfirmed, bool signed, Money fee, decimal feePercentOfSent, IEnumerable<SmartCoin> outerWalletOutputs, IEnumerable<SmartCoin> innerWalletOutputs, IEnumerable<SmartCoin> spentCoins)
+ public BuildTransactionResult(Network network, SmartTransaction transaction, PSBT psbt, bool spendsUnconfirmed, bool signed, Money fee, decimal feePercentOfSent, IEnumerable<SmartCoin> outerWalletOutputs, IEnumerable<SmartCoin> innerWalletOutputs, IEnumerable<SmartCoin> spentCoins)
{
- Store = Guard.NotNull(nameof(store), store);
Network = Guard.NotNull(nameof(network), network);
Transaction = Guard.NotNull(nameof(transaction), transaction);
Psbt = Guard.NotNull(nameof(psbt), psbt);
@@ -24,7 +22,6 @@ namespace WalletWasabi.Blockchain.TransactionBuilding
SpentCoins = Guard.NotNullOrEmpty(nameof(spentCoins), spentCoins);
}
- public BitcoinStore Store { get; }
public Network Network { get; }
public SmartTransaction Transaction { get; }
public PSBT Psbt { get; }

MODIFY
WalletWasabi/Blockchain/Transactions/TransactionFactory.cs
WalletWasabi/Blockchain/Transactions/TransactionFactory.cs
@@ -307,7 +307,7 @@ namespace WalletWasabi.Blockchain.Transactions
Logger.LogInfo($"Transaction is successfully built: {tx.GetHash()}.");
var sign = !KeyManager.IsWatchOnly;
var spendsUnconfirmed = spentCoins.Any(c => !c.Confirmed);
- return new BuildTransactionResult(Store, Network, new SmartTransaction(tx, Height.Unknown), psbt, spendsUnconfirmed, sign, fee, feePc, outerWalletOutputs, innerWalletOutputs, spentCoins);
+ return new BuildTransactionResult(Network, new SmartTransaction(tx, Height.Unknown), psbt, spendsUnconfirmed, sign, fee, feePc, outerWalletOutputs, innerWalletOutputs, spentCoins);
}
private PSBT TryNegotiatePayjoin(IPayjoinClient payjoinClient, TransactionBuilder builder, PSBT psbt)

remove bitcoinstore ref in BuildTxnResult and pass it to TDVM instead.