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 fb5e534
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions client/src/http_sender.rs
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,8 @@ impl RpcSender for HttpSender {
requests_and_params: Vec<(RpcRequest, serde_json::Value)>,
) -> Result<serde_json::Value> {
let mut batch_request = vec![];
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));
for (request_id, req) in requests_and_params.into_iter().enumerate() {
batch_request.push(req.0.build_request_json(request_id as u64, req.1));
}

let resp = self
Expand Down

0 comments on commit fb5e534

Please sign in to comment.