Implement DisplayAddress with fingerprint
MODIFY
WalletWasabi.Tests/HwiTests/DeviceConnectedTests/Katas.cs
WalletWasabi.Tests/HwiTests/DeviceConnectedTests/Katas.cs
@@ -84,7 +84,7 @@ namespace WalletWasabi.Tests.HwiTests.DeviceConnectedTests
// USER: CONFIRM
BitcoinWitPubKeyAddress address1 = await client.DisplayAddressAsync(deviceType, devicePath, keyPath1, cts.Token);
// USER: CONFIRM
- BitcoinWitPubKeyAddress address2 = await client.DisplayAddressAsync(deviceType, devicePath, keyPath2, cts.Token);
+ BitcoinWitPubKeyAddress address2 = await client.DisplayAddressAsync(fingerprint, keyPath2, cts.Token);
Assert.NotNull(address1);
Assert.NotNull(address2);
Assert.NotEqual(address1, address2);

MODIFY
WalletWasabi/Hwi2/HwiClient.cs
WalletWasabi/Hwi2/HwiClient.cs
@@ -105,9 +105,29 @@ namespace WalletWasabi.Hwi2
}
public async Task<BitcoinWitPubKeyAddress> DisplayAddressAsync(HardwareWalletVendors deviceType, string devicePath, KeyPath keyPath, CancellationToken cancel)
+ => await DisplayAddressImplAsync(deviceType, devicePath, null, keyPath, cancel);
+
+ public async Task<BitcoinWitPubKeyAddress> DisplayAddressAsync(HDFingerprint fingerprint, KeyPath keyPath, CancellationToken cancel)
+ => await DisplayAddressImplAsync(null, null, fingerprint, keyPath, cancel);
+
+ private async Task<BitcoinWitPubKeyAddress> DisplayAddressImplAsync(HardwareWalletVendors? deviceType, string devicePath, HDFingerprint? fingerprint, KeyPath keyPath, CancellationToken cancel)
+ {
+ var options = new List<HwiOption>();
+ if (devicePath != null)
+ {
+ options.Add(HwiOption.DevicePath(devicePath));
+ }
+ if (deviceType.HasValue)
{
+ options.Add(HwiOption.DeviceType(deviceType.Value));
+ }
+ if (fingerprint.HasValue)
+ {
+ options.Add(HwiOption.Fingerprint(fingerprint.Value));
+ }
+
var response = await SendCommandAsync(
- options: new[] { HwiOption.DevicePath(devicePath), HwiOption.DeviceType(deviceType) },
+ options: options.ToArray(),
command: HwiCommands.DisplayAddress,
commandArguments: $"--path {keyPath.ToString(true, "h")} --wpkh",
cancel).ConfigureAwait(false);

Implement DisplayAddress with fingerprint