pybit/py3/block.py
def api_verify(self,
                   url: str="https://blockchain.info/rawtx/",
                   wait: bool=False) -> None:
        """Validate transaction against blockchain.info.

        Query a block hash from Blockchain.info's api. Check it matches the
        blockon size, merkle root, number of transactions, previous block hash

        Respects apis request limting queries to 1 every 10s. If wait is True,
        waits to query. If false, skips.

        TODO:
            - Tidy printing
        """
        if self.verb > 4:
            print("{0}{1}Validating{1}".format(" "*4,
                                               "_"*10))

        jr = self.api_get(url=url,
                          wait=wait)

        if jr is not None:
            # Use these fields for validation
            validationFields = {
                self.txIn[0].scriptSig: jr['inputs'][0]['script'],
                self.txOut[0].pkScript: jr['out'][0]['script'],
                self.txOut[0].outputAddr: bytes(jr['out'][0]['addr'], 'utf-8')}

            self.api_validated = self.api_check(jr, validationFields)
        else:
            self.api_validated = 'Skipped'

        # Report
        if self.verb > 4:
            print("{0}Validation passed: {1}\n{0}{2}".format(
                                            " "*4,
                                            self.api_validated,
                                            "_"*30))
Validate transaction against blockchain.info.

        Query a block hash from Blockchain.info's api. Check it matches the
        blockon size, merkle root, number of transactions, previous block hash

        Respects apis request limting queries to 1 every 10s. If wait is True,
        waits to query. If false, skips.

        TODO:
            - Tidy printing
        


Respects apis request limting queries to 1 every 10s. If wait is True,
waits to query. If false, skips.

Tidy printing
Respects apis request limting queries to 1 every 10s . If wait is True waits to query . If false skips . Tidy printing
def api_verify(self,
                   url: str="https://blockchain.info/rawtx/",
                   wait: bool=False) -> None:
        if self.verb > 4:
            print("{0}{1}Validating{1}".format(" "*4,
                                               "_"*10))
        jr = self.api_get(url=url,
                          wait=wait)
        if jr is not None:
            validationFields = {
                self.txIn[0].scriptSig: jr['inputs'][0]['script'],
                self.txOut[0].pkScript: jr['out'][0]['script'],
                self.txOut[0].outputAddr: bytes(jr['out'][0]['addr'], 'utf-8')}
            self.api_validated = self.api_check(jr, validationFields)
        else:
            self.api_validated = 'Skipped'
        if self.verb > 4:
            print("{0}Validation passed: {1}\n{0}{2}".format(
                                            " "*4,
                                            self.api_validated,
                                            "_"*30))
def api_verify ( self , url : str = "https://blockchain.info/rawtx/" , wait : bool = False ) -> None : if self . verb > 4 : print ( "{0}{1}Validating{1}" . format ( " " * 4 , "_" * 10 ) ) jr = self . api_get ( url = url , wait = wait ) if jr is not None : validationFields = { self . txIn [ 0 ] . scriptSig : jr [ 'inputs' ] [ 0 ] [ 'script' ] , self . txOut [ 0 ] . pkScript : jr [ 'out' ] [ 0 ] [ 'script' ] , self . txOut [ 0 ] . outputAddr : bytes ( jr [ 'out' ] [ 0 ] [ 'addr' ] , 'utf-8' ) } self . api_validated = self . api_check ( jr , validationFields ) else : self . api_validated = 'Skipped' if self . verb > 4 : print ( "{0}Validation passed: {1}\n{0}{2}" . format ( " " * 4 , self . api_validated , "_" * 30 ) )
Validate transaction against blockchain.info.
Validate transaction against blockchain . info .
"""Validate transaction against blockchain.info.

        Query a block hash from Blockchain.info's api. Check it matches the
        blockon size, merkle root, number of transactions, previous block hash

        Respects apis request limting queries to 1 every 10s. If wait is True,
        waits to query. If false, skips.

        TODO:
            - Tidy printing
        """ # Use these fields for validation # Report
self
url
str
wait
bool