refactor txbuilding
MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/SendTabViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/SendTabViewModel.cs
@@ -279,15 +279,15 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
if (IsTransactionBuilder)
{
- var txviewer = IoC.Get<IShell>().Documents.OfType<TransactionViewerViewModel>().FirstOrDefault();
+ var txviewer = IoC.Get<IShell>()?.Documents?.OfType<TransactionViewerViewModel>()?.FirstOrDefault(x => x.Id == Id);
if (txviewer is null)
{
- txviewer = new TransactionViewerViewModel(null);
+ txviewer = new TransactionViewerViewModel(Wallet);
IoC.Get<IShell>().AddDocument(txviewer);
}
IoC.Get<IShell>().Select(txviewer);
- txviewer.UpdatePsbt(result.Psbt, result.Transaction);
+ txviewer.Update(result);
TryResetInputsOnSuccess("Transaction is successfully built!");
return;

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/TransactionViewerViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/TransactionViewerViewModel.cs
@@ -79,13 +79,13 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
return base.OnClose();
}
- public void UpdatePsbt(PSBT psbt, SmartTransaction transaction)
+ public void Update(BuildTransactionResult result)
{
try
{
- PsbtJsonText = psbt.ToString();
- TransactionHexText = transaction?.Transaction.ToHex();
- PsbtBase64Text = psbt.ToBase64();
+ PsbtJsonText = result.Psbt.ToString();
+ TransactionHexText = result.Transaction.Transaction.ToHex();
+ PsbtBase64Text = result.Psbt.ToBase64();
}
catch (Exception ex)
{

refactor txbuilding