Broadcasting logic
MODIFY
WalletWasabi.Fluent/ViewModels/NavBar/NavBarViewModel.cs
WalletWasabi.Fluent/ViewModels/NavBar/NavBarViewModel.cs
@@ -257,7 +257,7 @@ namespace WalletWasabi.Fluent.ViewModels.NavBar
category: "General",
keywords: "Transaction Id, Input, Output, Amount, Network, Fee, Count, BTC, Signed, Paste, Import, Broadcast, Transaction",
iconName: "live_regular",
- createTargetView: () => new TransactionBroadcasterViewModel());
+ createTargetView: () => new LoadTransactionViewModel());
}
private static void RegisterRootEntries(

RENAME
WalletWasabi.Fluent/ViewModels/TransactionBroadcaster/TransactionBroadcasterViewModel.cs
WalletWasabi.Fluent/ViewModels/TransactionBroadcaster/LoadTransactionViewModel.cs
@@ -18,11 +18,11 @@ using WalletWasabi.Stores;
namespace WalletWasabi.Fluent.ViewModels.TransactionBroadcaster
{
- public class TransactionBroadcasterViewModel : RoutableViewModel
+ public class LoadTransactionViewModel : RoutableViewModel
{
private SmartTransaction? _finalTransaction;
- public TransactionBroadcasterViewModel()
+ public LoadTransactionViewModel()
{
var global = Locator.Current.GetService<Global>();
@@ -36,7 +36,7 @@ namespace WalletWasabi.Fluent.ViewModels.TransactionBroadcaster
{
try
{
- var res = TransactionDetailsViewModel.FromBuildTxnResult(BitcoinStore, PSBT.FromTransaction(x!.Transaction, Network));
+ Navigate().To(new BroadcastTransactionViewModel(BitcoinStore, x!, Network, global.TransactionBroadcaster));
}
catch (Exception ex)
{
@@ -116,8 +116,9 @@ namespace WalletWasabi.Fluent.ViewModels.TransactionBroadcaster
private async Task<SmartTransaction> ParseTransactionAsync(string path)
{
var psbtBytes = await File.ReadAllBytesAsync(path);
- PSBT psbt = null;
- Transaction transaction = null;
+ PSBT? psbt = null;
+ Transaction? transaction = null;
+
try
{
psbt = PSBT.Load(psbtBytes, Network);
@@ -145,10 +146,8 @@ namespace WalletWasabi.Fluent.ViewModels.TransactionBroadcaster
return psbt.ExtractSmartTransaction();
}
- else
- {
+
return new SmartTransaction(transaction, Models.Height.Unknown);
}
}
}
\ No newline at end of file
-}
\ No newline at end of file

ADD
WalletWasabi.Fluent/Views/TransactionBroadcaster/BroadcastTransactionView.axaml
+<UserControl xmlns="https://github.com/avaloniaui"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:c="clr-namespace:WalletWasabi.Fluent.Controls"
+ xmlns:tB="clr-namespace:WalletWasabi.Fluent.ViewModels.TransactionBroadcaster"
+ mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
+ x:DataType="tB:BroadcastTransactionViewModel"
+ x:CompileBindings="True"
+ x:Class="WalletWasabi.Fluent.Views.TransactionBroadcaster.BroadcastTransactionView">
+ <c:ContentArea Title="Transaction ID"
+ Caption="{Binding TransactionId}"
+ EnableCancel="True"
+ EnableNext="True" NextContent="Broadcast"
+ IsBusy="{Binding IsBusy}">
+
+
+ </c:ContentArea>
+</UserControl>
\ No newline at end of file

RENAME
WalletWasabi.Fluent/Views/TransactionBroadcaster/TransactionBroadcasterView.axaml.cs
WalletWasabi.Fluent/Views/TransactionBroadcaster/BroadcastTransactionView.axaml.cs
@@ -4,9 +4,9 @@ using WalletWasabi.Fluent.ViewModels.TransactionBroadcaster;
namespace WalletWasabi.Fluent.Views.TransactionBroadcaster
{
- public class TransactionBroadcasterView : ReactiveUserControl<TransactionBroadcasterViewModel>
+ public class BroadcastTransactionView : ReactiveUserControl<BroadcastTransactionViewModel>
{
- public TransactionBroadcasterView()
+ public BroadcastTransactionView()
{
InitializeComponent();
}

RENAME
WalletWasabi.Fluent/Views/TransactionBroadcaster/TransactionBroadcasterView.axaml
WalletWasabi.Fluent/Views/TransactionBroadcaster/LoadTransactionView.axaml
xmlns:c="clr-namespace:WalletWasabi.Fluent.Controls"
xmlns:tB="clr-namespace:WalletWasabi.Fluent.ViewModels.TransactionBroadcaster"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
- x:DataType="tB:TransactionBroadcasterViewModel"
+ x:DataType="tB:LoadTransactionViewModel"
x:CompileBindings="True"
- x:Class="WalletWasabi.Fluent.Views.TransactionBroadcaster.TransactionBroadcasterView">
+ x:Class="WalletWasabi.Fluent.Views.TransactionBroadcaster.LoadTransactionView">
<c:ContentArea Title="Transaction Broadcaster"
Caption="Paste or import the transaction and broadcast it to the network."
EnableCancel="True">

ADD
WalletWasabi.Fluent/Views/TransactionBroadcaster/LoadTransactionView.axaml.cs
+using Avalonia.Markup.Xaml;
+using Avalonia.ReactiveUI;
+using WalletWasabi.Fluent.ViewModels.TransactionBroadcaster;
+
+namespace WalletWasabi.Fluent.Views.TransactionBroadcaster
+{
+ public class LoadTransactionView : ReactiveUserControl<LoadTransactionViewModel>
+ {
+ public LoadTransactionView()
+ {
+ InitializeComponent();
+ }
+
+ private void InitializeComponent()
+ {
+ AvaloniaXamlLoader.Load(this);
+ }
+ }
+}

MODIFY
WalletWasabi.Fluent/WalletWasabi.Fluent.csproj
WalletWasabi.Fluent/WalletWasabi.Fluent.csproj
<DependentUpon>InfoMessage.axaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
- <Compile Update="Views\TransactionBroadcaster\TransactionBroadcasterView.axaml.cs">
+ <Compile Update="Views\TransactionBroadcaster\LoadTransactionView.axaml.cs">
<DependentUpon>TransactionBroadcasterView.axaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
+ <Compile Update="Views\TransactionBroadcaster\BroadcastTransactionView.axaml.cs">
+ <DependentUpon>BroadcastTransactionView.axaml</DependentUpon>
+ <SubType>Code</SubType>
+ </Compile>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Avalonia.ReactiveUI" Version="0.10.999-cibuild0012072-beta" />

Broadcasting logic