-
Notifications
You must be signed in to change notification settings - Fork 713
Log index (preparation) #9481
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Log index (preparation) #9481
Changes from 19 commits
932a514
b8737e6
9db5e50
ba8a015
89a8a0f
603fe10
c943cc8
a878d04
b747de8
f9e1b73
32b5e98
2275555
de056e5
d58e556
330e6a0
6e7fbc3
70156c2
74f9252
06fef18
5b493a9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| // SPDX-FileCopyrightText: 2025 Demerzel Solutions Limited | ||
| // SPDX-License-Identifier: LGPL-3.0-only | ||
|
|
||
| using System; | ||
| using System.Collections.Generic; | ||
| using Nethermind.Crypto; | ||
|
|
||
|
benaadams marked this conversation as resolved.
|
||
| namespace Nethermind.Core.Test.Builders; | ||
|
|
||
| public static class RandomExtensions | ||
| { | ||
| public static T NextFrom<T>(this Random random, IReadOnlyList<T> values) => values[random.Next(values.Count)]; | ||
|
|
||
| public static T NextFrom<T>(this ICryptoRandom random, IReadOnlyList<T> values) => values[random.NextInt(values.Count)]; | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -69,6 +69,11 @@ public interface IWriteOnlyKeyValueStore | |
| void Remove(ReadOnlySpan<byte> key) => Set(key, null); | ||
| } | ||
|
|
||
| public interface IMergeableKeyValueStore : IWriteOnlyKeyValueStore | ||
| { | ||
| void Merge(ReadOnlySpan<byte> key, ReadOnlySpan<byte> value, WriteFlags flags = WriteFlags.None); | ||
| } | ||
|
|
||
| public interface ISortedKeyValueStore : IKeyValueStore | ||
| { | ||
| byte[]? FirstKey { get; } | ||
|
|
@@ -82,6 +87,7 @@ public interface ISortedKeyValueStore : IKeyValueStore | |
| /// </summary> | ||
| public interface ISortedView : IDisposable | ||
| { | ||
| public bool StartBefore(ReadOnlySpan<byte> value); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, need to start exactly before so lower bound may not work as a starting point. Still prefer to have lower bound present - for example, for correct check on iterator validity. Plus, if key before is out of bounds - need to start at the lower bound. |
||
| public bool MoveNext(); | ||
| public ReadOnlySpan<byte> CurrentKey { get; } | ||
| public ReadOnlySpan<byte> CurrentValue { get; } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.