Ejemplo n.º 1
0
def verify_p2pkh():
    """
    Unlocking P2PKH script
    """
    b = Bitcoin(True)
    # From the Redeemer
    sig = input("Input sig: ")
    pubkey = input("Input pubkey: ")
    b.push(sig)
    b.push(pubkey)

    # Unlocking Script
    locking_script = input("Enter locking script:")
    for word in locking_script.split():
        if word[:2] == "OP":
            res = b.interpreter(word)()
            if res == False:
                break
        else:
            print("pushing {}".format(word))
            b.push(word)
Ejemplo n.º 2
0
import pytest
from time import sleep
from bitcoin import Bitcoin

b = Bitcoin()


class TestBTCFeeEstimates:
    def test_btc_fee_estimate(self):
        sleep(1)
        output = b.fee_estimates()
        print(output['data'])
        assert output['status'] == 'successful'