Skip to content

Commit dca2863

Browse files
jonatackmeshcollider
authored andcommitted
test: ensure OP_1NEGATE satisfies BIP62 minimal push rule
with a regression test for PR 13084 and PR 17204.
1 parent e629d07 commit dca2863

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

test/functional/rpc_signrawtransaction.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,10 +198,30 @@ def verify_txn_with_witness_script(self, tx_type):
198198
assert_equal(spending_tx_signed['complete'], True)
199199
self.nodes[0].sendrawtransaction(spending_tx_signed['hex'])
200200

201+
def OP_1NEGATE_test(self):
202+
self.log.info("Test OP_1NEGATE (0x4f) satisfies BIP62 minimal push standardness rule")
203+
hex_str = (
204+
"0200000001FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
205+
"FFFFFFFF00000000044F024F9CFDFFFFFF01F0B9F5050000000023210277777777"
206+
"77777777777777777777777777777777777777777777777777777777AC66030000"
207+
)
208+
prev_txs = [
209+
{
210+
"txid": "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF",
211+
"vout": 0,
212+
"scriptPubKey": "A914AE44AB6E9AA0B71F1CD2B453B69340E9BFBAEF6087",
213+
"redeemScript": "4F9C",
214+
"amount": 1,
215+
}
216+
]
217+
txn = self.nodes[0].signrawtransactionwithwallet(hex_str, prev_txs)
218+
assert txn["complete"]
219+
201220
def run_test(self):
202221
self.successful_signing_test()
203222
self.script_verification_error_test()
204223
self.witness_script_test()
224+
self.OP_1NEGATE_test()
205225
self.test_with_lock_outputs()
206226

207227

0 commit comments

Comments
 (0)