Changeset View
Changeset View
Standalone View
Standalone View
test/functional/abc-schnorrmultisig.py
Show All 10 Lines | |||||
- check banning of peers for some fully-invalid transactions. | - check banning of peers for some fully-invalid transactions. | ||||
Derived from abc-schnorr.py | Derived from abc-schnorr.py | ||||
""" | """ | ||||
from test_framework.blocktools import ( | from test_framework.blocktools import ( | ||||
create_block, | create_block, | ||||
create_coinbase, | create_coinbase, | ||||
create_transaction, | create_tx_with_script, | ||||
make_conform_to_ctor, | make_conform_to_ctor, | ||||
) | ) | ||||
from test_framework.key import CECKey | from test_framework.key import CECKey | ||||
from test_framework.messages import ( | from test_framework.messages import ( | ||||
CBlock, | CBlock, | ||||
COutPoint, | COutPoint, | ||||
CTransaction, | CTransaction, | ||||
CTxIn, | CTxIn, | ||||
▲ Show 20 Lines • Show All 133 Lines • ▼ Show 20 Lines | def run_test(self): | ||||
def create_fund_and_spend_tx(dummy=OP_0, sigtype='ecdsa'): | def create_fund_and_spend_tx(dummy=OP_0, sigtype='ecdsa'): | ||||
spendfrom = spendable_outputs.pop() | spendfrom = spendable_outputs.pop() | ||||
script = CScript([OP_1, public_key, OP_1, OP_CHECKMULTISIG]) | script = CScript([OP_1, public_key, OP_1, OP_CHECKMULTISIG]) | ||||
value = spendfrom.vout[0].nValue | value = spendfrom.vout[0].nValue | ||||
# Fund transaction | # Fund transaction | ||||
txfund = create_transaction(spendfrom, 0, b'', value, script) | txfund = create_tx_with_script(spendfrom, 0, b'', value, script) | ||||
txfund.rehash() | txfund.rehash() | ||||
fundings.append(txfund) | fundings.append(txfund) | ||||
# Spend transaction | # Spend transaction | ||||
txspend = CTransaction() | txspend = CTransaction() | ||||
txspend.vout.append( | txspend.vout.append( | ||||
CTxOut(value - 1000, CScript([OP_TRUE]))) | CTxOut(value - 1000, CScript([OP_TRUE]))) | ||||
txspend.vin.append( | txspend.vin.append( | ||||
▲ Show 20 Lines • Show All 70 Lines • Show Last 20 Lines |