Skip to content

Commit 3d8f065

Browse files
committed
fix: correct casing for FuzzTests folder name
1 parent 3acb766 commit 3d8f065

File tree

4 files changed

+43
-44
lines changed

4 files changed

+43
-44
lines changed

NLightning.sln

+3-3
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,13 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Fuzztests", "Fuzztests", "{
4141
EndProject
4242
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "NLightning.Bolts.BOLT11", "NLightning.Bolts.BOLT11", "{79B6F41F-3E5A-4ABF-83A4-5860F9ADAC35}"
4343
EndProject
44-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "InvoiceRoundTripFuzzer", "test\Fuzztests\NLightning.Bolts.BOLT11\InvoiceRoundTripFuzzer\InvoiceRoundTripFuzzer.csproj", "{201CF0D3-AA8A-40D3-843E-4382F9EDEABA}"
44+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "InvoiceRoundTripFuzzer", "test\FuzzTests\NLightning.Bolts.BOLT11\InvoiceRoundTripFuzzer\InvoiceRoundTripFuzzer.csproj", "{201CF0D3-AA8A-40D3-843E-4382F9EDEABA}"
4545
EndProject
4646
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "NLightning.Bolts.BOLT8", "NLightning.Bolts.BOLT8", "{6BECD5C6-9978-41E1-BAC0-854E16F0D142}"
4747
EndProject
48-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ActOneFuzzer", "test\Fuzztests\NLightning.Bolts.BOLT8\ActOneFuzzer\ActOneFuzzer.csproj", "{A7C2075F-1C1E-4EE6-A2FE-D65EFBB2D662}"
48+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ActOneFuzzer", "test\FuzzTests\NLightning.Bolts.BOLT8\ActOneFuzzer\ActOneFuzzer.csproj", "{A7C2075F-1C1E-4EE6-A2FE-D65EFBB2D662}"
4949
EndProject
50-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ActTwoFuzzer", "test\Fuzztests\NLightning.Bolts.BOLT8\ActTwoFuzzer\ActTwoFuzzer.csproj", "{8A99EB76-83DA-4E88-A7F8-265224F901D5}"
50+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ActTwoFuzzer", "test\FuzzTests\NLightning.Bolts.BOLT8\ActTwoFuzzer\ActTwoFuzzer.csproj", "{8A99EB76-83DA-4E88-A7F8-265224F901D5}"
5151
EndProject
5252
Global
5353
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
1-
using NLightning.Bolts.BOLT11;
2-
using NLightning.Bolts.Exceptions;
3-
using SharpFuzz;
4-
5-
namespace InvoiceRoundTripFuzzer;
6-
7-
internal abstract class InvoiceRoundTripFuzzer
8-
{
9-
private static void Main()
10-
{
11-
Fuzzer.OutOfProcess.Run(stream =>
12-
{
13-
//pwsh ../../fuzz.ps1 InvoiceRoundTripFuzzer.csproj -i Testcases
14-
try
15-
{
16-
using var reader = new StreamReader(stream);
17-
18-
var invoiceData = reader.ReadToEnd();
19-
20-
var invoice = Invoice.Decode(invoiceData);
21-
22-
var encodedInvoice = invoice.Encode();
23-
24-
if (!invoiceData.Equals(encodedInvoice, StringComparison.OrdinalIgnoreCase))
25-
{
26-
throw new Exception("Invoice mismatch");
27-
}
28-
29-
}
30-
catch (InvoiceSerializationException) { }
31-
});
32-
}
1+
using NLightning.Bolts.BOLT11;
2+
using NLightning.Bolts.Exceptions;
3+
using SharpFuzz;
4+
5+
namespace InvoiceRoundTripFuzzer;
6+
7+
internal abstract class InvoiceRoundTripFuzzer
8+
{
9+
private static void Main()
10+
{
11+
Fuzzer.OutOfProcess.Run(stream =>
12+
{
13+
//pwsh ../../fuzz.ps1 InvoiceRoundTripFuzzer.csproj -i Testcases
14+
try
15+
{
16+
using var reader = new StreamReader(stream);
17+
18+
var invoiceData = reader.ReadToEnd();
19+
20+
var invoice = Invoice.Decode(invoiceData);
21+
22+
var encodedInvoice = invoice.Encode();
23+
24+
if (!invoiceData.Equals(encodedInvoice, StringComparison.OrdinalIgnoreCase))
25+
{
26+
throw new Exception("Invoice mismatch");
27+
}
28+
29+
}
30+
catch (InvoiceSerializationException) { }
31+
});
32+
}
3333
}

test/FuzzTests/NLightning.Bolts.BOLT8/ActOneFuzzer/Program.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System.Security.Cryptography;
1+
using System.Security.Cryptography;
22
using NLightning.Bolts.BOLT8.Constants;
33
using NLightning.Bolts.BOLT8.States;
44
using NLightning.Bolts.Tests.BOLT8.Mock;
@@ -19,14 +19,14 @@ private static void Main()
1919
using var memory = new MemoryStream();
2020
stream.CopyTo(memory);
2121
var data = memory.ToArray().AsSpan();
22-
22+
2323
var responder = new HandshakeState(
2424
false,
2525
ResponderValidKeysUtil.LocalStaticPrivateKey,
2626
ResponderValidKeysUtil.LocalStaticPublicKey,
2727
new FakeFixedKeyDh(ResponderValidKeysUtil.EphemeralPrivateKey)
2828
);
29-
29+
3030
var buffer = new byte[ProtocolConstants.MAX_MESSAGE_LENGTH];
3131
responder.ReadMessage(data, buffer);
3232
}

test/FuzzTests/NLightning.Bolts.BOLT8/ActTwoFuzzer/Program.cs

+5-6
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,18 @@ private static void Main()
2020
using var memory = new MemoryStream();
2121
stream.CopyTo(memory);
2222
var data = memory.ToArray().AsSpan();
23-
23+
2424
var initiator = new HandshakeState(
2525
true,
2626
InitiatorValidKeysUtil.LocalStaticPrivateKey,
2727
InitiatorValidKeysUtil.RemoteStaticPublicKey,
2828
new FakeFixedKeyDh(InitiatorValidKeysUtil.EphemeralPrivateKey)
2929
);
30-
30+
3131
var buffer = new byte[ProtocolConstants.MAX_MESSAGE_LENGTH];
32-
32+
3333
initiator.WriteMessage(Encoding.ASCII.GetBytes(string.Empty), buffer);
34-
34+
3535
initiator.ReadMessage(data, buffer);
3636
}
3737
catch (ObjectDisposedException) { }
@@ -42,5 +42,4 @@ private static void Main()
4242

4343
});
4444
}
45-
}
46-
45+
}

0 commit comments

Comments
 (0)