def build_spending_tx(script_sig, credit_tx): tx = Transaction(version=1, locktime=0) txin = CMutableTxIn(CMutableOutPoint(credit_tx.GetHash(), 0), script_sig) tx.vin = [txin] txout = CMutableTxOut(0, Script()) tx.vout = [txout] return tx
def build_crediting_tx(script_pubkey): tx = Transaction(version=1, locktime=0) txin = CMutableTxIn() txin.scriptSig = Script.from_human('0x00 0x00') tx.vin = [txin] txout = CMutableTxOut(0, script_pubkey) tx.vout = [txout] return tx