MCPcopy Create free account
hub / github.com/ElementsProject/elements / invalidate_nulldummy_tx

Function invalidate_nulldummy_tx

test/functional/feature_nulldummy.py:38–43  ·  view source on GitHub ↗

Transform a NULLDUMMY compliant tx (i.e. scriptSig starts with OP_0) to be non-NULLDUMMY compliant by replacing the dummy with OP_TRUE

(tx)

Source from the content-addressed store, hash-verified

36NULLDUMMY_ERROR = "mempool-script-verify-flag-failed (Dummy CHECKMULTISIG argument must be zero)"
37
38def invalidate_nulldummy_tx(tx):
39 """Transform a NULLDUMMY compliant tx (i.e. scriptSig starts with OP_0)
40 to be non-NULLDUMMY compliant by replacing the dummy with OP_TRUE"""
41 assert_equal(tx.vin[0].scriptSig[0], OP_0)
42 tx.vin[0].scriptSig = bytes([OP_TRUE]) + tx.vin[0].scriptSig[1:]
43 tx.rehash()
44
45
46class NULLDUMMYTest(BitcoinTestFramework):

Callers 1

run_testMethod · 0.85

Calls 2

assert_equalFunction · 0.90
rehashMethod · 0.45

Tested by

no test coverage detected