chore: remove Sync bound from cursor associated types (#21486)

Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
Matthias Seitz
2026-01-27 19:31:40 +01:00
committed by GitHub
parent ba8c8354e5
commit 9eaa5a6303
2 changed files with 7 additions and 8 deletions

View File

@@ -20,9 +20,9 @@ pub type DupCursorMutTy<TX, T> = <TX as DbTxMut>::DupCursorMut<T>;
/// Read only transaction
pub trait DbTx: Debug + Send {
/// Cursor type for this read-only transaction
type Cursor<T: Table>: DbCursorRO<T> + Send + Sync;
type Cursor<T: Table>: DbCursorRO<T> + Send;
/// `DupCursor` type for this read-only transaction
type DupCursor<T: DupSort>: DbDupCursorRO<T> + DbCursorRO<T> + Send + Sync;
type DupCursor<T: DupSort>: DbDupCursorRO<T> + DbCursorRO<T> + Send;
/// Get value by an owned key
fn get<T: Table>(&self, key: T::Key) -> Result<Option<T::Value>, DatabaseError>;
@@ -51,14 +51,13 @@ pub trait DbTx: Debug + Send {
/// Read write transaction that allows writing to database
pub trait DbTxMut: Send {
/// Read-Write Cursor type
type CursorMut<T: Table>: DbCursorRW<T> + DbCursorRO<T> + Send + Sync;
type CursorMut<T: Table>: DbCursorRW<T> + DbCursorRO<T> + Send;
/// Read-Write `DupCursor` type
type DupCursorMut<T: DupSort>: DbDupCursorRW<T>
+ DbCursorRW<T>
+ DbDupCursorRO<T>
+ DbCursorRO<T>
+ Send
+ Sync;
+ Send;
/// Put value to database
fn put<T: Table>(&self, key: T::Key, value: T::Value) -> Result<(), DatabaseError>;

View File

@@ -64,7 +64,7 @@ impl<C> DatabaseAccountTrieCursor<C> {
impl<C> TrieCursor for DatabaseAccountTrieCursor<C>
where
C: DbCursorRO<tables::AccountsTrie> + Send + Sync,
C: DbCursorRO<tables::AccountsTrie> + Send,
{
/// Seeks an exact match for the provided key in the account trie.
fn seek_exact(
@@ -160,7 +160,7 @@ where
impl<C> TrieCursor for DatabaseStorageTrieCursor<C>
where
C: DbCursorRO<tables::StoragesTrie> + DbDupCursorRO<tables::StoragesTrie> + Send + Sync,
C: DbCursorRO<tables::StoragesTrie> + DbDupCursorRO<tables::StoragesTrie> + Send,
{
/// Seeks an exact match for the given key in the storage trie.
fn seek_exact(
@@ -202,7 +202,7 @@ where
impl<C> TrieStorageCursor for DatabaseStorageTrieCursor<C>
where
C: DbCursorRO<tables::StoragesTrie> + DbDupCursorRO<tables::StoragesTrie> + Send + Sync,
C: DbCursorRO<tables::StoragesTrie> + DbDupCursorRO<tables::StoragesTrie> + Send,
{
fn set_hashed_address(&mut self, hashed_address: B256) {
self.hashed_address = hashed_address;