Skip to content

Commit

Permalink
Refactoring (NethermindEth#6635)
Browse files Browse the repository at this point in the history
* Resolved conflicts

* max body size for http json rpc (NethermindEth#36)

* Format

* Self-recovery of TxPool max capacity

* fix ProcessedTransactionsDbCleanerTests

* Update txPool worst value if removal unsuccessful (NethermindEth#6702)

(cherry picked from commit f262cb2)

* Clearer error message for missing starting block state (NethermindEth#6672)

* Update txPool worst value if removal unsuccessful (NethermindEth#6702)

* Add Cancun hard-fork settings for Gnosis (NethermindEth#6709)

* Cancun spec and config for mainnet (NethermindEth#6679)

* Add Paris release spec class for completeness (NethermindEth#6633)

* 0.0.0.0 to +

---------

Co-authored-by: smartprogrammer <smartprogrammer@windowslive.com>
Co-authored-by: Marcin Sobczak <marcindsobczak@gmail.com>
Co-authored-by: Ben Adams <thundercat@illyriad.co.uk>
Co-authored-by: Ruben Buniatyan <rubo@users.noreply.github.com>
Co-authored-by: Ahmad Bitar <33181301+smartprogrammer93@users.noreply.github.com>
Co-authored-by: Kamil Chodoła <kamil@nethermind.io>
Co-authored-by: Lukasz Rozmej <lukasz.rozmej@gmail.com>
  • Loading branch information
8 people authored and gr8h committed Jun 25, 2024
1 parent f9b37b4 commit 6bf9f39
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Nethermind/Nethermind.Core/Extensions/SpanExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,13 @@ private static string ToHexStringWithEip55Checksum(ReadOnlySpan<byte> bytes, boo
return result;
}

public static ReadOnlySpan<byte> TakeAndMove(this ref ReadOnlySpan<byte> span, int length)
{
ReadOnlySpan<byte> s = span[..length];
span = span[length..];
return s;
}

public static bool IsNullOrEmpty<T>(this in Span<T> span) => span.Length == 0;
public static bool IsNull<T>(this in Span<T> span) => Unsafe.IsNullRef(ref MemoryMarshal.GetReference(span));
public static bool IsNullOrEmpty<T>(this in ReadOnlySpan<T> span) => span.Length == 0;
Expand Down

0 comments on commit 6bf9f39

Please sign in to comment.