Changeset View
Changeset View
Standalone View
Standalone View
test/functional/mempool_accept.py
Show First 20 Lines • Show All 288 Lines • ▼ Show 20 Lines | def run_test(self): | ||||
# Some not-pushonly scriptSig | # Some not-pushonly scriptSig | ||||
tx.vin[0].scriptSig = CScript([OP_HASH160]) | tx.vin[0].scriptSig = CScript([OP_HASH160]) | ||||
self.check_mempool_result( | self.check_mempool_result( | ||||
result_expected=[{'txid': tx.rehash( | result_expected=[{'txid': tx.rehash( | ||||
), 'allowed': False, 'reject-reason': 'scriptsig-not-pushonly'}], | ), 'allowed': False, 'reject-reason': 'scriptsig-not-pushonly'}], | ||||
rawtxs=[ToHex(tx)], | rawtxs=[ToHex(tx)], | ||||
) | ) | ||||
tx = FromHex(CTransaction(), raw_tx_reference) | tx = FromHex(CTransaction(), raw_tx_reference) | ||||
# Some too large scriptSig (>1650 bytes) | |||||
tx.vin[0].scriptSig = CScript([b'a' * 1648]) | |||||
self.check_mempool_result( | |||||
result_expected=[{'txid': tx.rehash(), 'allowed': False, | |||||
'reject-reason': 'scriptsig-size'}], | |||||
rawtxs=[tx.serialize().hex()], | |||||
) | |||||
tx = FromHex(CTransaction(), raw_tx_reference) | |||||
output_p2sh_burn = CTxOut(nValue=540, scriptPubKey=CScript( | output_p2sh_burn = CTxOut(nValue=540, scriptPubKey=CScript( | ||||
[OP_HASH160, hash160(b'burn'), OP_EQUAL])) | [OP_HASH160, hash160(b'burn'), OP_EQUAL])) | ||||
# Use enough outputs to make the tx too large for our policy | # Use enough outputs to make the tx too large for our policy | ||||
num_scripts = 100000 // len(output_p2sh_burn.serialize()) | num_scripts = 100000 // len(output_p2sh_burn.serialize()) | ||||
tx.vout = [output_p2sh_burn] * num_scripts | tx.vout = [output_p2sh_burn] * num_scripts | ||||
self.check_mempool_result( | self.check_mempool_result( | ||||
result_expected=[ | result_expected=[ | ||||
{'txid': tx.rehash(), 'allowed': False, 'reject-reason': 'tx-size'}], | {'txid': tx.rehash(), 'allowed': False, 'reject-reason': 'tx-size'}], | ||||
▲ Show 20 Lines • Show All 48 Lines • Show Last 20 Lines |