Skip to content

Commit

Permalink
Merge pull request #5476 from molnard/backport1_1_12_7
Browse files Browse the repository at this point in the history
[Backport v1.1.12.7] Cherry picking
  • Loading branch information
molnard committed Mar 30, 2021
2 parents 2cdbb51 + 2191d91 commit 27cb50a
Show file tree
Hide file tree
Showing 12 changed files with 62 additions and 6 deletions.
13 changes: 13 additions & 0 deletions WalletWasabi.Gui/Rpc/WasabiJsonRpcService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,19 @@ public async Task<object> SendTransactionAsync(PaymentInfo[] payments, OutPoint[
};
}

[JsonRpcMethod("broadcast")]
public async Task<object> SendRawTransactionAsync(string txHex)
{
txHex = Guard.Correct(txHex);
var smartTx = new SmartTransaction(Transaction.Parse(txHex, Global.Network), Height.Mempool);

await Global.TransactionBroadcaster.SendTransactionAsync(smartTx).ConfigureAwait(false);
return new
{
txid = smartTx.Transaction.GetHash()
};
}

[JsonRpcMethod("gethistory")]
public object[] GetHistory()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,13 @@ public RecoverWalletViewModel(WalletManagerViewModel owner) : base("Recover Wall

MnemonicWords = "";

var numberOfWords = MnemonicWords.Split(' ', StringSplitOptions.RemoveEmptyEntries).Length;

var canExecute = Observable
.Merge(Observable.FromEventPattern(this, nameof(ErrorsChanged)).Select(_ => Unit.Default))
.Merge(this.WhenAnyValue(x => x.MnemonicWords).Select(_ => Unit.Default))
.ObserveOn(RxApp.MainThreadScheduler)
.Select(_ => !Validations.AnyErrors && MnemonicWords.Split(' ', StringSplitOptions.RemoveEmptyEntries).Length == 12);
.Select(_ => !Validations.AnyErrors && (numberOfWords == 12 || numberOfWords == 15 || numberOfWords == 18 || numberOfWords == 21 || numberOfWords == 24));

RecoverCommand = ReactiveCommand.Create(() => RecoverWallet(owner), canExecute);

Expand Down
41 changes: 41 additions & 0 deletions WalletWasabi.Tests/UnitTests/Hwi/HwiBinaryHashesTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Runtime.InteropServices;
using System.Security.Cryptography;
using System.Threading;
using WalletWasabi.Microservices;
using Xunit;

namespace WalletWasabi.Tests.UnitTests.Hwi
{
public class HwiBinaryHashesTests
{
/// <summary>
/// Verifies HWI binaries distributed with Wasabi Wallet against checksums on https://github.com/bitcoin-core/HWI/releases/.
/// </summary>
/// <seealso href="https://github.com/bitcoin-core/HWI/releases/download/2.0.1/SHA256SUMS.txt.asc">Our current HWI version is 2.0.1.</seealso>
[Fact]
public void VerifyHwiBinaryChecksumHashes()
{
using var cts = new CancellationTokenSource(5_000);

Dictionary<OSPlatform, string> expectedHashes = new Dictionary<OSPlatform, string>()
{
{ OSPlatform.Windows, "2cfdd6ae51e345f8c70214d626430c8d236336688a87f7d85fc6f3d6a8392da8" },
{ OSPlatform.Linux, "ca1f91593b3c0a99269ecbc0f85aced08e2dec4bf263cfb25429e047e63e38d5" },
{ OSPlatform.OSX, "389afc3927cbc6ce01f464d8d6fa66bf050d2b7d17d7127d1c1e6ee89c5b5ec1" },
};

foreach (var item in expectedHashes)
{
string binaryFolder = MicroserviceHelpers.GetBinaryFolder(item.Key);
string filePath = Path.Combine(binaryFolder, item.Key == OSPlatform.Windows ? "hwi.exe" : "hwi");

using SHA256 sha256 = SHA256.Create();
using FileStream fileStream = File.OpenRead(filePath);
Assert.Equal(item.Value, ByteHelpers.ToHex(sha256.ComputeHash(fileStream)).ToLowerInvariant());
}
}
}
}
4 changes: 2 additions & 2 deletions WalletWasabi/Helpers/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ public static class Constants

public const long MaxSatoshisSupply = 2_100_000_000_000_000L;

public static readonly Version ClientVersion = new Version(1, 1, 12, 6);
public static readonly Version HwiVersion = new Version("2.0.0");
public static readonly Version ClientVersion = new Version(1, 1, 12, 7);
public static readonly Version HwiVersion = new Version("2.0.1");
public static readonly Version BitcoinCoreVersion = new Version("0.21.0");
public static readonly Version LegalDocumentsVersion = new Version(2, 0);

Expand Down
Binary file modified WalletWasabi/Microservices/Binaries/lin64/hwi
Binary file not shown.
Binary file modified WalletWasabi/Microservices/Binaries/osx64/hwi
Binary file not shown.
Binary file modified WalletWasabi/Microservices/Binaries/win64/hwi.exe
Binary file not shown.
Binary file modified WalletWasabi/TorDaemons/data-folder.zip
Binary file not shown.
6 changes: 3 additions & 3 deletions WalletWasabi/TorDaemons/digests.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
ed212d0d7dcfd3cd3736333f1c8932698db5a61e9989f1b7fd65ccc9c03ecd31
f98b80eec7e203209adbeee32c85fb824f7563845f848f27529403a744d92ec8
886960e5698cd275f81e2ad3b9654275172a30f6e9f16ddf09b6b96ad4b50403
621eb6ff196c9cd3262c3a13f8c9f2821f65083db53957bc993ae51bd3616865
efd78d3ed57072772617dfb106859f5faebe7cdf0a91ba0a7ac3976a31ce0371
13b2a562aebb29307c23fa1eee1a22dd53b941d8919695d37771b37bd75d15bf
Binary file modified WalletWasabi/TorDaemons/tor-linux64.zip
Binary file not shown.
Binary file modified WalletWasabi/TorDaemons/tor-osx64.zip
Binary file not shown.
Binary file modified WalletWasabi/TorDaemons/tor-win64.zip
Binary file not shown.

0 comments on commit 27cb50a

Please sign in to comment.