forked from WalletWasabi/WalletWasabi
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request WalletWasabi#12258 from turbolay/improveMostUsedLa…
…bels Improve most used labels
- Loading branch information
Showing
4 changed files
with
50 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,14 @@ | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using NBitcoin; | ||
using WalletWasabi.Blockchain.Analysis.Clustering; | ||
using WalletWasabi.Blockchain.Keys; | ||
using WalletWasabi.Extensions; | ||
|
||
namespace WalletWasabi.Fluent.Helpers; | ||
|
||
public static class KeyManagerExtensions | ||
{ | ||
public static IEnumerable<LabelsArray> GetChangeLabels(this KeyManager km) => | ||
km.GetKeys(isInternal: true).Select(x => x.Labels); | ||
|
||
public static IEnumerable<LabelsArray> GetReceiveLabels(this KeyManager km) => | ||
km.GetKeys(isInternal: false).Select(x => x.Labels); | ||
public static (List<string>, List<string>) GetLabels(this KeyManager km) | ||
{ | ||
var (changeKeys, receiveKeys) = km.GetKeys().Partition(x => x.IsInternal); | ||
return (changeKeys.SelectMany(x => x.Labels).ToList(), receiveKeys.SelectMany(x => x.Labels).ToList()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters