Skip to content

Commit

Permalink
Add get_headers client function
Browse files Browse the repository at this point in the history
  • Loading branch information
keyvank committed Nov 25, 2022
1 parent aa180f6 commit d723f1a
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,20 @@ impl BazukaClient {
.await
}

pub async fn get_headers(
&self,
since: u64,
count: u64,
) -> Result<GetHeadersResponse, NodeError> {
self.sender
.bincode_get::<GetHeadersRequest, GetHeadersResponse>(
format!("http://{}/bincode/headers", self.peer),
GetHeadersRequest { since, count },
Limit::default(),
)
.await
}

pub async fn get_zero_mempool(&self) -> Result<GetZeroMempoolResponse, NodeError> {
self.sender
.bincode_get::<GetZeroMempoolRequest, GetZeroMempoolResponse>(
Expand Down

0 comments on commit d723f1a

Please sign in to comment.