pybit/Examples/Py3_BlockchainInfoAPI.py
def trans_validate(trans,
                   pr=True):
    """
    Query a transaction hash from Blockchain.info's api.
    Check it matches on:
        - Stuff

    Respects apis request limting queries to 1 every 10s.

    Handles single input
    """

    jr = get_resp(trans.hash,
                  lastTime=0,
                  url="https://blockchain.info/rawtx/",
                  pr=True)

    # Input 0 script
    t1 = jr['inputs'][0]['script'] == trans.txIn[0].scriptSig
    if pr:
        print(t1)

    # Output 0 script
    t2 = jr['out'][0]['script'] == trans.txOut[0].pkScript
    if pr:
        print(t2)

    # Decoded output address
    t3 = jr['out'][0]['addr'] == trans.txOut[0].outputAddr
    if pr:
        print(t3)

    # The the overall result
    result = t1 & t2 & t3

    # Report
    if pr:
        if result:
            print("Pass")
        else:
            print("Fail")

    return lastTime, result

    Query a transaction hash from Blockchain.info's api.
    Check it matches on:
        - Stuff

    Respects apis request limting queries to 1 every 10s.

    Handles single input
    
Query a transaction hash from Blockchain.info's api.
Check it matches on:
Stuff

Respects apis request limting queries to 1 every 10s.

Handles single input
Query a transaction hash from Blockchain . info ' s api . Check it matches on : Stuff Respects apis request limting queries to 1 every 10s . Handles single input
def trans_validate(trans,
                   pr=True):
    jr = get_resp(trans.hash,
                  lastTime=0,
                  url="https://blockchain.info/rawtx/",
                  pr=True)
    t1 = jr['inputs'][0]['script'] == trans.txIn[0].scriptSig
    if pr:
        print(t1)
    t2 = jr['out'][0]['script'] == trans.txOut[0].pkScript
    if pr:
        print(t2)
    t3 = jr['out'][0]['addr'] == trans.txOut[0].outputAddr
    if pr:
        print(t3)
    result = t1 & t2 & t3
    if pr:
        if result:
            print("Pass")
        else:
            print("Fail")
    return lastTime, result
def trans_validate ( trans , pr = True ) : jr = get_resp ( trans . hash , lastTime = 0 , url = "https://blockchain.info/rawtx/" , pr = True ) t1 = jr [ 'inputs' ] [ 0 ] [ 'script' ] == trans . txIn [ 0 ] . scriptSig if pr : print ( t1 ) t2 = jr [ 'out' ] [ 0 ] [ 'script' ] == trans . txOut [ 0 ] . pkScript if pr : print ( t2 ) t3 = jr [ 'out' ] [ 0 ] [ 'addr' ] == trans . txOut [ 0 ] . outputAddr if pr : print ( t3 ) result = t1 & t2 & t3 if pr : if result : print ( "Pass" ) else : print ( "Fail" ) return lastTime , result
Query a transaction hash from Blockchain.info's api.
Query a transaction hash from Blockchain . info ' s api .
"""
    Query a transaction hash from Blockchain.info's api.
    Check it matches on:
        - Stuff

    Respects apis request limting queries to 1 every 10s.

    Handles single input
    """ # Input 0 script # Output 0 script # Decoded output address # The the overall result # Report
trans
pr