def _export_batch(self, batch_start, batch_end): blocks_rpc = list(generate_get_block_by_number_json_rpc(batch_start, batch_end, self.export_transactions)) response = self.ipc_wrapper.make_request(json.dumps(blocks_rpc)) for response_item in response: result = response_item['result'] block = self.block_mapper.json_dict_to_block(result) self._export_block(block)
def _export_batch(self, batch_start, batch_end): blocks_rpc = list( generate_get_block_by_number_json_rpc(batch_start, batch_end, self.export_transactions)) response = self.ipc_wrapper.make_request(json.dumps(blocks_rpc)) results = rpc_response_batch_to_results(response) blocks = [ self.block_mapper.json_dict_to_block(result) for result in results ] for block in blocks: self._export_block(block)
def _export_batch(self, batch_start, batch_end): blocks_rpc = list( generate_get_block_by_number_json_rpc(batch_start, batch_end, self.export_transactions)) serialized_blocks_rpc = [ json.dumps(block_rpc) for block_rpc in blocks_rpc ] response = self.ipc_wrapper.make_request( '\n'.join(serialized_blocks_rpc)) for item in response.splitlines(): decoded_item = json.loads(item) result = decoded_item['result'] block = self.block_mapper.json_dict_to_block(result) self._export_block(block)