From 6bf9f39866bbf25151fc5b2a1cf6b5457b9bcd00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Moraczy=C5=84ski?= Date: Fri, 16 Feb 2024 15:41:31 +0100 Subject: [PATCH] Refactoring (#6635) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Resolved conflicts * max body size for http json rpc (#36) * Format * Self-recovery of TxPool max capacity * fix ProcessedTransactionsDbCleanerTests * Update txPool worst value if removal unsuccessful (#6702) (cherry picked from commit f262cb26350dcdf2fd6cbceee9f5ed4f2c5f197c) * Clearer error message for missing starting block state (#6672) * Update txPool worst value if removal unsuccessful (#6702) * Add Cancun hard-fork settings for Gnosis (#6709) * Cancun spec and config for mainnet (#6679) * Add Paris release spec class for completeness (#6633) * 0.0.0.0 to + --------- Co-authored-by: smartprogrammer Co-authored-by: Marcin Sobczak Co-authored-by: Ben Adams Co-authored-by: Ruben Buniatyan Co-authored-by: Ahmad Bitar <33181301+smartprogrammer93@users.noreply.github.com> Co-authored-by: Kamil ChodoĊ‚a Co-authored-by: Lukasz Rozmej --- .../Nethermind.Core/Extensions/SpanExtensions.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Nethermind/Nethermind.Core/Extensions/SpanExtensions.cs b/src/Nethermind/Nethermind.Core/Extensions/SpanExtensions.cs index 8d0608b049ea..99b4b7645fea 100644 --- a/src/Nethermind/Nethermind.Core/Extensions/SpanExtensions.cs +++ b/src/Nethermind/Nethermind.Core/Extensions/SpanExtensions.cs @@ -148,6 +148,13 @@ private static string ToHexStringWithEip55Checksum(ReadOnlySpan bytes, boo return result; } + public static ReadOnlySpan TakeAndMove(this ref ReadOnlySpan span, int length) + { + ReadOnlySpan s = span[..length]; + span = span[length..]; + return s; + } + public static bool IsNullOrEmpty(this in Span span) => span.Length == 0; public static bool IsNull(this in Span span) => Unsafe.IsNullRef(ref MemoryMarshal.GetReference(span)); public static bool IsNullOrEmpty(this in ReadOnlySpan span) => span.Length == 0;