-
Notifications
You must be signed in to change notification settings - Fork 479
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Alexey <[email protected]> Co-authored-by: Ben Adams <[email protected]> Co-authored-by: Lukasz Rozmej <[email protected]> Co-authored-by: Ruben Buniatyan <[email protected]>
- Loading branch information
1 parent
ebc0def
commit d3d0ec0
Showing
78 changed files
with
3,352 additions
and
56 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
11 changes: 11 additions & 0 deletions
11
src/Nethermind/Nethermind.Consensus/Processing/IReadOnlyTxProcessingEnvFactory.cs
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// SPDX-FileCopyrightText: 2024 Demerzel Solutions Limited | ||
// SPDX-License-Identifier: LGPL-3.0-only | ||
|
||
using Nethermind.Evm.TransactionProcessing; | ||
|
||
namespace Nethermind.Consensus.Processing; | ||
|
||
public interface IReadOnlyTxProcessingEnvFactory | ||
{ | ||
public IReadOnlyTxProcessorSource Create(); | ||
} |
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
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
26 changes: 26 additions & 0 deletions
26
src/Nethermind/Nethermind.Consensus/Producers/FailBlockProducer.cs
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// SPDX-FileCopyrightText: 2024 Demerzel Solutions Limited | ||
// SPDX-License-Identifier: LGPL-3.0-only | ||
|
||
using System; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using Nethermind.Core; | ||
using Nethermind.Evm.Tracing; | ||
|
||
namespace Nethermind.Consensus.Producers; | ||
|
||
/// <summary> | ||
/// A BlockProducer that always fails. | ||
/// It is used in tests or when the node is not supposed to produce blocks, and we want to detect block production being triggered. | ||
/// </summary> | ||
public class FailBlockProducer : IBlockProducer | ||
{ | ||
public Task<Block?> BuildBlock( | ||
BlockHeader? parentHeader = null, | ||
IBlockTracer? blockTracer = null, | ||
PayloadAttributes? payloadAttributes = null, | ||
CancellationToken? cancellationToken = null) | ||
{ | ||
throw new InvalidOperationException("FailBlockProducer is not supposed to produce blocks."); | ||
} | ||
} |
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
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
30 changes: 30 additions & 0 deletions
30
src/Nethermind/Nethermind.Core.Test/Json/Base64ConverterTests.cs
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// SPDX-FileCopyrightText: 2024 Demerzel Solutions Limited | ||
// SPDX-License-Identifier: LGPL-3.0-only | ||
|
||
using Nethermind.Serialization.Json; | ||
using NUnit.Framework; | ||
using System.Linq; | ||
|
||
namespace Nethermind.Core.Test.Json; | ||
|
||
[TestFixture] | ||
public class Base64ConverterTests : ConverterTestBase<byte[]?> | ||
{ | ||
[TestCase(null)] | ||
[TestCase(new byte[0])] | ||
[TestCase(new byte[] { 1 })] | ||
[TestCase(new byte[] { 0, 1 })] | ||
[TestCase(new byte[] { 0, 0, 1 })] | ||
[TestCase(new byte[] { 0, 0, 255 })] | ||
[TestCase(new byte[] { 0, 0, 1, 0 })] | ||
[TestCase(new byte[] { 0, 0, 1, 0, 0 })] | ||
[TestCase(new byte[] { 0, 0, 1, 0, 127 })] | ||
[TestCase(new byte[] { 0, 0, 1, 0, 255 })] | ||
public void ValueWithAndWithoutLeadingZeros_are_equal(byte[]? value) | ||
{ | ||
TestConverter( | ||
value, | ||
(before, after) => (before is null && after is null) || (before is not null && after is not null && before.SequenceEqual(after)), | ||
new Base64Converter()); | ||
} | ||
} |
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
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
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
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
Oops, something went wrong.