Esempio n. 1
0
    def _send_batch(self):
        with self._lock:
            url = random.choice(self._urls) if \
                len(self._urls) > 0 else None

        batch_id = None
        if url is not None:
            txns = []
            for _ in range(0, 1):
                txns.append(create_noop_transaction(self._signer))

            batch = create_batch(transactions=txns, signer=self._signer)

            batch_id = batch.header_signature

            batch_list = batch_pb2.BatchList(batches=[batch])
            post_batches(url, batch_list)

            self.delegate.on_new_batch(batch_id, url)
Esempio n. 2
0
    def _send_batch(self):
        with self._lock:
            url = random.choice(self._urls) if \
                len(self._urls) > 0 else None

        batch_id = None
        if url is not None:
            txns = []
            for _ in range(0, 1):
                txns.append(create_noop_transaction(self._signer))

            batch = create_batch(
                transactions=txns,
                signer=self._signer)

            batch_id = batch.header_signature

            batch_list = batch_pb2.BatchList(batches=[batch])
            post_batches(url, batch_list)

            self.delegate.on_new_batch(batch_id, url)