(self, regions)
Confirm transmission of an API message

        Args:
            regions : Regions that were covered by the transmission
Confirm transmission of an API message
Confirm transmission of an API message
def confirm_tx(self, regions):
        """Confirm transmission of an API message

        Args:
            regions : Regions that were covered by the transmission

        """
        assert (self.seq_num is not None)

        if ((regions is None) or (self.tls_cert is None)
                or (self.tls_key is None)):
            return

        assert (isinstance(regions, list))

        logger.info("Confirm transmission of message {} on regions {}".format(
            self.seq_num, regions))

        r = requests.post(self.server + '/order/tx/' + str(self.seq_num),
                          data={'regions': json.dumps(regions)},
                          cert=(self.tls_cert, self.tls_key))

        if not r.ok:
            logger.error("Failed to confirm Tx of message {} "
                         "[status code {}]".format(self.seq_num,
                                                   r.status_code))
            self._print_errors(r)
        else:
            logger.info("Server response: " + r.json()['message'])
def confirm_tx ( self , regions ) : assert ( self . seq_num is not None ) if ( ( regions is None ) or ( self . tls_cert is None ) or ( self . tls_key is None ) ) : return assert ( isinstance ( regions , list ) ) logger . info ( "Confirm transmission of message {} on regions {}" . format ( self . seq_num , regions ) ) r = requests . post ( self . server + '/order/tx/' + str ( self . seq_num ) , data = { 'regions' : json . dumps ( regions ) } , cert = ( self . tls_cert , self . tls_key ) ) if not r . ok : logger . error ( "Failed to confirm Tx of message {} " "[status code {}]" . format ( self . seq_num , r . status_code ) ) self . _print_errors ( r ) else : logger . info ( "Server response: " + r . json ( ) [ 'message' ] )