Skip to content

Commit b7eb8fe

Browse files
Code Cleanup
1 parent 6325cd6 commit b7eb8fe

5 files changed

Lines changed: 37 additions & 38 deletions

File tree

‎Src/FinderOuter/ListHelper.cs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@ public static IEnumerable<DescriptiveItem<T>> GetEnumDescItems<T>(params T[] exc
3131

3232
public static IEnumerable<DescriptiveHelpInput> GetEnumDescHelpInput()
3333
{
34-
foreach (HelpInputTypes item in Enum.GetValues(typeof(HelpInputTypes)))
34+
foreach (HelpInputTypes item in Enum.GetValues<HelpInputTypes>())
3535
{
3636
yield return new DescriptiveHelpInput(item);
3737
}
3838
}
3939

4040
public static IEnumerable<DescriptiveKB> GetEnumDescKB()
4141
{
42-
foreach (KB item in Enum.GetValues(typeof(KB)))
42+
foreach (KB item in Enum.GetValues<KB>())
4343
{
4444
yield return new DescriptiveKB(item);
4545
}

‎Src/FinderOuter/Models/DescriptiveItem.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public class DescriptiveHelpInput2(HelpSecondInputTypes value) : DescriptiveItem
3535
{
3636
}
3737

38-
public class DescriptiveKB(KB value): DescriptiveItem<KB>(value)
38+
public class DescriptiveKB(KB value) : DescriptiveItem<KB>(value)
3939
{
4040
}
4141
}

‎Src/FinderOuter/Services/Bip32PathService.cs‎

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -37,44 +37,44 @@ public enum SeedType
3737
//XPUB
3838
}
3939

40-
private static readonly BIP0032Path[] AllPaths = new BIP0032Path[]
41-
{
42-
new BIP0032Path("m/0"),
43-
new BIP0032Path("m/0'"),
40+
private static readonly BIP0032Path[] AllPaths =
41+
[
42+
new("m/0"),
43+
new("m/0'"),
4444
// BIP-44 xprv/xpub P2PKH
45-
new BIP0032Path("m/44'/0'/0'/0"),
45+
new("m/44'/0'/0'/0"),
4646
// BIP-49 yprv/upub P2SH-P2WPKH
47-
new BIP0032Path("m/49'/0'/0'/0"),
47+
new("m/49'/0'/0'/0"),
4848
// BIP-84 zprv/zpub P2WPKH
49-
new BIP0032Path("m/84'/0'/0'/0"),
50-
};
49+
new("m/84'/0'/0'/0"),
50+
];
5151

5252

5353
public void Loop(BIP0032 bip32, uint count)
5454
{
55-
BIP0032Path[] allPaths = new BIP0032Path[]
56-
{
57-
new BIP0032Path("m/0"),
58-
new BIP0032Path("m/0'"),
59-
new BIP0032Path("m/0'/0/"),
60-
new BIP0032Path("m/0'/0'"),
55+
BIP0032Path[] allPaths =
56+
[
57+
new("m/0"),
58+
new("m/0'"),
59+
new("m/0'/0/"),
60+
new("m/0'/0'"),
6161
// BIP-44 xprv/xpub P2PKH
62-
new BIP0032Path("m/44'/0'/0'/0"),
63-
new BIP0032Path("m/44'/0'/0'"),
62+
new("m/44'/0'/0'/0"),
63+
new("m/44'/0'/0'"),
6464
// BIP-49 yprv/upub P2SH-P2WPKH
65-
new BIP0032Path("m/49'/0'/0'/0"),
66-
new BIP0032Path("m/49'/0'/0'"),
65+
new("m/49'/0'/0'/0"),
66+
new("m/49'/0'/0'"),
6767
// BIP-84 zprv/zpub P2WPKH
68-
new BIP0032Path("m/84'/0'/0'/0"),
69-
new BIP0032Path("m/84'/0'/0'/"),
70-
new BIP0032Path("m/84'/0'/2147483644'/0"),
71-
new BIP0032Path("m/84'/0'/2147483645'/0"),
72-
new BIP0032Path("m/84'/0'/2147483646'/0"),
73-
new BIP0032Path("m/84'/0'/2147483647'/0"),
74-
new BIP0032Path("m/49'/0'/2147483647'/0"),
75-
new BIP0032Path("m/44'/0'/2147483647'/0"),
76-
new BIP0032Path("m/141'/0'/0'/0"),
77-
};
68+
new("m/84'/0'/0'/0"),
69+
new("m/84'/0'/0'/"),
70+
new("m/84'/0'/2147483644'/0"),
71+
new("m/84'/0'/2147483645'/0"),
72+
new("m/84'/0'/2147483646'/0"),
73+
new("m/84'/0'/2147483647'/0"),
74+
new("m/49'/0'/2147483647'/0"),
75+
new("m/44'/0'/2147483647'/0"),
76+
new("m/141'/0'/0'/0"),
77+
];
7878

7979

8080
foreach (BIP0032Path path in allPaths)

‎Src/FinderOuter/Services/Comparers/PrvToPubComparer.cs‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
// Distributed under the MIT software license, see the accompanying
44
// file LICENCE or http://www.opensource.org/licenses/mit-license.php.
55

6-
using Autarkysoft.Bitcoin.Cryptography.Asymmetric.EllipticCurve;
76
using Autarkysoft.Bitcoin.Cryptography.EllipticCurve;
87
using Autarkysoft.Bitcoin.Cryptography.EllipticCurve.Primitives;
98
using Autarkysoft.Bitcoin.Encoders;
@@ -12,7 +11,7 @@
1211
namespace FinderOuter.Services.Comparers
1312
{
1413
/// <summary>
15-
/// Converts private key to an <see cref="EllipticCurvePoint"/> and compares it with the pubkey (point).
14+
/// Converts private key to an <see cref="Point"/> and compares it with the pubkey (point).
1615
/// </summary>
1716
public class PrvToPubComparer : ICompareService
1817
{

‎Src/FinderOuter/ViewModels/MissingEncodingViewModel.cs‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ public MissingEncodingViewModel()
2020
{
2121
EncodingList = new EncodingState[]
2222
{
23-
new EncodingState(EncodingName.Base16),
24-
new EncodingState(EncodingName.Base43),
25-
new EncodingState(EncodingName.Base58),
26-
new EncodingState(EncodingName.Base58Check),
27-
new EncodingState(EncodingName.Base64),
23+
new(EncodingName.Base16),
24+
new(EncodingName.Base43),
25+
new(EncodingName.Base58),
26+
new(EncodingName.Base58Check),
27+
new(EncodingName.Base64),
2828
};
2929

3030
IObservable<bool> isFindEnabled = this.WhenAnyValue(

0 commit comments

Comments
 (0)