Skip to content

Commit

Permalink
use deterministic req ids in batch calls
Browse files Browse the repository at this point in the history
  • Loading branch information
segfaultdoc committed Nov 18, 2022
1 parent aa3711a commit b93ceb6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion client/src/http_sender.rs
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,10 @@ impl RpcSender for HttpSender {
requests_and_params: Vec<(RpcRequest, serde_json::Value)>,
) -> Result<serde_json::Value> {
let mut batch_request = vec![];
let mut request_id = 0;
for (rpc_req, params) in requests_and_params {
let request_id = self.request_id.fetch_add(1, Ordering::Relaxed);
batch_request.push(rpc_req.build_request_json(request_id, params));
request_id += 1;
}

let resp = self
Expand Down

0 comments on commit b93ceb6

Please sign in to comment.