mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-07 13:18:43 +02:00
scripted-diff: validation: rename mandatory errors into block errors
Using "block" or "mempool" as the prefix in place of "mandatory" or "non-mandatory" is clearer to a user. "non-mandatory" was renamed into "mempool" as part of #33050. This takes care of the other half of this renaming as a scripted diff. -BEGIN VERIFY SCRIPT- sed -i 's/mandatory-script-verify/block-script-verify/g' $(git grep -l mandatory-script-verify) -END VERIFY SCRIPT-
This commit is contained in:
@@ -403,9 +403,9 @@ class BIP68_112_113Test(BitcoinTestFramework):
|
||||
|
||||
# -1 OP_CSV tx and (empty stack) OP_CSV tx should fail
|
||||
self.send_blocks([self.create_test_block([bip112tx_special_v1])], success=False,
|
||||
reject_reason='mandatory-script-verify-flag-failed (Negative locktime)')
|
||||
reject_reason='block-script-verify-flag-failed (Negative locktime)')
|
||||
self.send_blocks([self.create_test_block([bip112tx_emptystack_v1])], success=False,
|
||||
reject_reason='mandatory-script-verify-flag-failed (Operation not valid with the current stack size)')
|
||||
reject_reason='block-script-verify-flag-failed (Operation not valid with the current stack size)')
|
||||
# If SEQUENCE_LOCKTIME_DISABLE_FLAG is set in argument to OP_CSV, version 1 txs should still pass
|
||||
|
||||
success_txs = [tx['tx'] for tx in bip112txs_vary_OP_CSV_v1 if tx['sdf']]
|
||||
@@ -420,15 +420,15 @@ class BIP68_112_113Test(BitcoinTestFramework):
|
||||
fail_txs += [tx['tx'] for tx in bip112txs_vary_OP_CSV_9_v1 if not tx['sdf']]
|
||||
for tx in fail_txs:
|
||||
self.send_blocks([self.create_test_block([tx])], success=False,
|
||||
reject_reason='mandatory-script-verify-flag-failed (Locktime requirement not satisfied)')
|
||||
reject_reason='block-script-verify-flag-failed (Locktime requirement not satisfied)')
|
||||
|
||||
self.log.info("Test version 2 txs")
|
||||
|
||||
# -1 OP_CSV tx and (empty stack) OP_CSV tx should fail
|
||||
self.send_blocks([self.create_test_block([bip112tx_special_v2])], success=False,
|
||||
reject_reason='mandatory-script-verify-flag-failed (Negative locktime)')
|
||||
reject_reason='block-script-verify-flag-failed (Negative locktime)')
|
||||
self.send_blocks([self.create_test_block([bip112tx_emptystack_v2])], success=False,
|
||||
reject_reason='mandatory-script-verify-flag-failed (Operation not valid with the current stack size)')
|
||||
reject_reason='block-script-verify-flag-failed (Operation not valid with the current stack size)')
|
||||
|
||||
# If SEQUENCE_LOCKTIME_DISABLE_FLAG is set in argument to OP_CSV, version 2 txs should pass (all sequence locks are met)
|
||||
success_txs = [tx['tx'] for tx in bip112txs_vary_OP_CSV_v2 if tx['sdf']]
|
||||
@@ -444,20 +444,20 @@ class BIP68_112_113Test(BitcoinTestFramework):
|
||||
fail_txs += [tx['tx'] for tx in bip112txs_vary_OP_CSV_9_v2 if not tx['sdf']]
|
||||
for tx in fail_txs:
|
||||
self.send_blocks([self.create_test_block([tx])], success=False,
|
||||
reject_reason='mandatory-script-verify-flag-failed (Locktime requirement not satisfied)')
|
||||
reject_reason='block-script-verify-flag-failed (Locktime requirement not satisfied)')
|
||||
|
||||
# If SEQUENCE_LOCKTIME_DISABLE_FLAG is set in nSequence, tx should fail
|
||||
fail_txs = [tx['tx'] for tx in bip112txs_vary_nSequence_v2 if tx['sdf']]
|
||||
for tx in fail_txs:
|
||||
self.send_blocks([self.create_test_block([tx])], success=False,
|
||||
reject_reason='mandatory-script-verify-flag-failed (Locktime requirement not satisfied)')
|
||||
reject_reason='block-script-verify-flag-failed (Locktime requirement not satisfied)')
|
||||
|
||||
# If sequencelock types mismatch, tx should fail
|
||||
fail_txs = [tx['tx'] for tx in bip112txs_vary_nSequence_v2 if not tx['sdf'] and tx['stf']]
|
||||
fail_txs += [tx['tx'] for tx in bip112txs_vary_OP_CSV_v2 if not tx['sdf'] and tx['stf']]
|
||||
for tx in fail_txs:
|
||||
self.send_blocks([self.create_test_block([tx])], success=False,
|
||||
reject_reason='mandatory-script-verify-flag-failed (Locktime requirement not satisfied)')
|
||||
reject_reason='block-script-verify-flag-failed (Locktime requirement not satisfied)')
|
||||
|
||||
# Remaining txs should pass, just test masking works properly
|
||||
success_txs = [tx['tx'] for tx in bip112txs_vary_nSequence_v2 if not tx['sdf'] and not tx['stf']]
|
||||
|
||||
Reference in New Issue
Block a user