Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions zingo-netutils/src/globally_public.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ pub trait TransparentIndexer: Indexer {
&mut self,
filter: TransparentAddressBlockFilter,
timeout: Duration,
) -> impl Future<Output = Result<tonic::Streaming<RawTransaction>, tonic::Status>>;
) -> impl Future<Output = Result<tonic::Streaming<RawTransaction>, tonic::Status>> + Send;

/// Return a stream of transactions for a transparent address in a block range.
///
Expand All @@ -43,7 +43,7 @@ pub trait TransparentIndexer: Indexer {
&mut self,
filter: TransparentAddressBlockFilter,
timeout: Duration,
) -> impl Future<Output = Result<tonic::Streaming<RawTransaction>, tonic::Status>>;
) -> impl Future<Output = Result<tonic::Streaming<RawTransaction>, tonic::Status>> + Send;

/// Return the total confirmed balance for the given transparent addresses.
///
Expand All @@ -53,7 +53,7 @@ pub trait TransparentIndexer: Indexer {
&mut self,
addresses: AddressList,
timeout: Duration,
) -> impl Future<Output = Result<Balance, tonic::Status>>;
) -> impl Future<Output = Result<Balance, tonic::Status>> + Send;

/// Return the total confirmed balance by streaming addresses to the server.
///
Expand All @@ -64,7 +64,7 @@ pub trait TransparentIndexer: Indexer {
fn get_taddress_balance_stream(
&mut self,
addresses: Vec<Address>,
) -> impl Future<Output = Result<Balance, tonic::Status>>;
) -> impl Future<Output = Result<Balance, tonic::Status>> + Send;

/// Return UTXOs for the given addresses as a single response.
///
Expand All @@ -74,7 +74,7 @@ pub trait TransparentIndexer: Indexer {
&mut self,
arg: GetAddressUtxosArg,
timeout: Duration,
) -> impl Future<Output = Result<GetAddressUtxosReplyList, tonic::Status>>;
) -> impl Future<Output = Result<GetAddressUtxosReplyList, tonic::Status>> + Send;

/// Return a stream of UTXOs for the given addresses.
///
Expand All @@ -86,7 +86,7 @@ pub trait TransparentIndexer: Indexer {
timeout: Duration,
) -> impl Future<
Output = Result<tonic::Streaming<GetAddressUtxosReply>, tonic::Status>,
>;
> + Send;
}

impl TransparentIndexer for GrpcIndexer {
Expand Down
28 changes: 14 additions & 14 deletions zingo-netutils/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,13 @@ pub trait Indexer {
/// The returned [`LightdInfo`] includes the chain name, current block height,
/// server version, and consensus branch ID. Callers should not cache this
/// value across sync boundaries as the block height is a point-in-time snapshot.
fn get_lightd_info(&mut self, timeout: Duration) -> impl Future<Output = Result<LightdInfo, tonic::Status>>;
fn get_lightd_info(&mut self, timeout: Duration) -> impl Future<Output = Result<LightdInfo, tonic::Status>> + Send;

/// Return the height and hash of the chain tip.
///
/// The returned [`BlockId`] identifies the most recent block the server
/// is aware of. The hash may be omitted by some implementations.
fn get_latest_block(&mut self, timeout: Duration) -> impl Future<Output = Result<BlockId, tonic::Status>>;
fn get_latest_block(&mut self, timeout: Duration) -> impl Future<Output = Result<BlockId, tonic::Status>> + Send;

/// Submit a raw transaction to the network.
///
Expand All @@ -99,7 +99,7 @@ pub trait Indexer {
&mut self,

tx: RawTransaction, timeout: Duration,
) -> impl Future<Output = Result<String, tonic::Status>>;
) -> impl Future<Output = Result<String, tonic::Status>> + Send;

/// Fetch the note commitment tree state for the given block.
///
Expand All @@ -110,7 +110,7 @@ tx: RawTransaction, timeout: Duration,
&mut self,
block_id: BlockId,
timeout: Duration,
) -> impl Future<Output = Result<TreeState, tonic::Status>>;
) -> impl Future<Output = Result<TreeState, tonic::Status>> + Send;

/// Return the compact block at the given height.
///
Expand All @@ -120,7 +120,7 @@ tx: RawTransaction, timeout: Duration,
&mut self,
block_id: BlockId,
timeout: Duration,
) -> impl Future<Output = Result<CompactBlock, tonic::Status>>;
) -> impl Future<Output = Result<CompactBlock, tonic::Status>> + Send;

/// Return the compact block at the given height, containing only nullifiers.
///
Expand All @@ -131,7 +131,7 @@ tx: RawTransaction, timeout: Duration,
&mut self,
block_id: BlockId,
timeout: Duration,
) -> impl Future<Output = Result<CompactBlock, tonic::Status>>;
) -> impl Future<Output = Result<CompactBlock, tonic::Status>> + Send;

/// Return a stream of consecutive compact blocks for the given range.
///
Expand All @@ -146,7 +146,7 @@ tx: RawTransaction, timeout: Duration,
&mut self,
range: BlockRange,
timeout: Duration,
) -> impl Future<Output = Result<tonic::Streaming<CompactBlock>, tonic::Status>>;
) -> impl Future<Output = Result<tonic::Streaming<CompactBlock>, tonic::Status>> + Send;

/// Return a stream of consecutive compact blocks (nullifiers only) for the given range.
///
Expand All @@ -158,7 +158,7 @@ tx: RawTransaction, timeout: Duration,
&mut self,
range: BlockRange,
timeout: Duration,
) -> impl Future<Output = Result<tonic::Streaming<CompactBlock>, tonic::Status>>;
) -> impl Future<Output = Result<tonic::Streaming<CompactBlock>, tonic::Status>> + Send;

/// Return the full serialized transaction matching the given filter.
///
Expand All @@ -169,7 +169,7 @@ tx: RawTransaction, timeout: Duration,
&mut self,
filter: TxFilter,
timeout: Duration,
) -> impl Future<Output = Result<RawTransaction, tonic::Status>>;
) -> impl Future<Output = Result<RawTransaction, tonic::Status>> + Send;

/// Return a stream of compact transactions currently in the mempool.
///
Expand All @@ -180,7 +180,7 @@ tx: RawTransaction, timeout: Duration,
&mut self,
request: GetMempoolTxRequest,
timeout: Duration,
) -> impl Future<Output = Result<tonic::Streaming<CompactTx>, tonic::Status>>;
) -> impl Future<Output = Result<tonic::Streaming<CompactTx>, tonic::Status>> + Send;

/// Return a stream of raw mempool transactions.
///
Expand All @@ -189,7 +189,7 @@ tx: RawTransaction, timeout: Duration,
fn get_mempool_stream(
&mut self,
timeout: Duration,
) -> impl Future<Output = Result<tonic::Streaming<RawTransaction>, tonic::Status>>;
) -> impl Future<Output = Result<tonic::Streaming<RawTransaction>, tonic::Status>> + Send;

/// Return the note commitment tree state at the chain tip.
///
Expand All @@ -198,7 +198,7 @@ tx: RawTransaction, timeout: Duration,
fn get_latest_tree_state(
&mut self,
timeout: Duration,
) -> impl Future<Output = Result<TreeState, tonic::Status>>;
) -> impl Future<Output = Result<TreeState, tonic::Status>> + Send;

/// Return a stream of subtree roots for the given shielded protocol.
///
Expand All @@ -208,7 +208,7 @@ tx: RawTransaction, timeout: Duration,
&mut self,
arg: GetSubtreeRootsArg,
timeout: Duration,
) -> impl Future<Output = Result<tonic::Streaming<SubtreeRoot>, tonic::Status>>;
) -> impl Future<Output = Result<tonic::Streaming<SubtreeRoot>, tonic::Status>> + Send;

/// Simulate server latency for testing.
///
Expand All @@ -221,7 +221,7 @@ tx: RawTransaction, timeout: Duration,
&mut self,
duration: ProtoDuration,
timeout: Duration,
) -> impl Future<Output = Result<PingResponse, tonic::Status>>;
) -> impl Future<Output = Result<PingResponse, tonic::Status>> + Send;
}

/// gRPC-backed [`Indexer`] that connects to a Zcash chain indexer (server).
Expand Down