Skip to content

Commit

Permalink
chore: add client getters
Browse files Browse the repository at this point in the history
commit-id:d27ad891
  • Loading branch information
nadin-Starkware committed Nov 14, 2024
1 parent 227611b commit a5bcac1
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions crates/starknet_sequencer_node/src/clients.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,19 +101,37 @@ impl SequencerNodeClients {
get_shared_client!(self, batcher_client)
}

pub fn get_batcher_client(&self) -> Option<&Client<BatcherRequest, BatcherResponse>> {
self.batcher_client.as_ref()
}

pub fn get_mempool_shared_client(&self) -> Option<SharedMempoolClient> {
get_shared_client!(self, mempool_client)
}

pub fn get_mempool_client(&self) -> Option<&Client<MempoolRequest, MempoolResponse>> {
self.mempool_client.as_ref()
}

pub fn get_gateway_shared_client(&self) -> Option<SharedGatewayClient> {
get_shared_client!(self, gateway_client)
}

pub fn get_gateway_client(&self) -> Option<&Client<GatewayRequest, GatewayResponse>> {
self.gateway_client.as_ref()
}

pub fn get_mempool_p2p_propagator_shared_client(
&self,
) -> Option<SharedMempoolP2pPropagatorClient> {
get_shared_client!(self, mempool_p2p_propagator_client)
}

pub fn get_mempool_p2p_propagator_client(
&self,
) -> Option<&Client<MempoolP2pPropagatorRequest, MempoolP2pPropagatorResponse>> {
self.mempool_p2p_propagator_client.as_ref()
}
}

/// A macro for creating a component client, determined by the component's execution mode. Returns a
Expand Down

0 comments on commit a5bcac1

Please sign in to comment.