Skip to content

Commit

Permalink
chore(trie): thread safe trie cursor (paradigmxyz#6854)
Browse files Browse the repository at this point in the history
  • Loading branch information
rkrasiuk authored and fgimenez committed Feb 29, 2024
1 parent d25489c commit 8c13b1b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions crates/trie/src/trie_cursor/database_cursors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ impl<C> DatabaseAccountTrieCursor<C> {

impl<C> TrieCursor for DatabaseAccountTrieCursor<C>
where
C: DbCursorRO<tables::AccountsTrie>,
C: DbCursorRO<tables::AccountsTrie> + Send + Sync,
{
/// Seeks an exact match for the provided key in the account trie.
fn seek_exact(
Expand Down Expand Up @@ -83,7 +83,7 @@ impl<C> DatabaseStorageTrieCursor<C> {

impl<C> TrieCursor for DatabaseStorageTrieCursor<C>
where
C: DbDupCursorRO<tables::StoragesTrie> + DbCursorRO<tables::StoragesTrie>,
C: DbDupCursorRO<tables::StoragesTrie> + DbCursorRO<tables::StoragesTrie> + Send + Sync,
{
/// Seeks an exact match for the given key in the storage trie.
fn seek_exact(
Expand Down
2 changes: 1 addition & 1 deletion crates/trie/src/trie_cursor/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pub trait TrieCursorFactory {

/// A cursor for navigating a trie that works with both Tables and DupSort tables.
#[auto_impl::auto_impl(&mut, Box)]
pub trait TrieCursor {
pub trait TrieCursor: Send + Sync {
/// Move the cursor to the key and return if it is an exact match.
fn seek_exact(
&mut self,
Expand Down

0 comments on commit 8c13b1b

Please sign in to comment.