Skip to content

Commit

Permalink
re add async trait
Browse files Browse the repository at this point in the history
  • Loading branch information
ec2 committed Sep 19, 2024
1 parent b3e8f23 commit c5fdec4
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions zcash_client_backend/src/data_api/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,7 @@ pub trait BlockSource {
/// assert_eq!(block_cache.get_tip_height(None).unwrap(), None);
/// ```
#[cfg(feature = "sync")]
#[async_trait]
pub trait BlockCache: BlockSource + Send + Sync
where
Self::Error: Send,
Expand Down
1 change: 1 addition & 0 deletions zcash_client_memory/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ thiserror = "1.0.61"

rayon.workspace = true
serde_with = "3.9.0"
async-trait = { version = "0.1" }

# - Test dependencies
proptest = { workspace = true, optional = true }
Expand Down
2 changes: 2 additions & 0 deletions zcash_client_memory/src/block_source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use zcash_client_backend::data_api::scanning::ScanRange;
use zcash_client_backend::proto::compact_formats::CompactBlock;
use zcash_protocol::consensus::BlockHeight;
use wasm_sync::RwLock;
use async_trait::async_trait;

/// A block cache that just holds blocks in a map in memory
#[derive(Default)]
Expand Down Expand Up @@ -59,6 +60,7 @@ impl BlockSource for MemBlockCache {
}
}

#[async_trait]
impl BlockCache for MemBlockCache {
fn get_tip_height(
&self,
Expand Down

0 comments on commit c5fdec4

Please sign in to comment.