bitcoin/test/functional/test_framework
Ava Chow 50b09e8173
Merge bitcoin/bitcoin#29615: test: fix accurate multisig sigop count (BIP16), add unit test
3e9c736a26 test: fix accurate multisig sigop count (BIP16), add unit test (Sebastian Falbesoner)

Pull request description:

  In the course of reviewing #29589 I noticed the following buggy call-site of `CScriptOp.decode_op_n` in the CScript's `GetSigOpCount` method:
  4cc99df44a/test/functional/test_framework/script.py (L591-L593)
  This should be `lastOpcode` rather than `opcode`. The latter is either OP_CHECKMULTISIG or OP_CHECKMULTISIGVERIFY at this point, so `decode_op_n` would result in an error. Also, in `CScript.raw_iter`, we have to return the op as `CScriptOp` type instead of a bare integer, otherwise we can't call the decode method on it. To prevent this in the future, add some simple unit tests for `GetSigOpCount`.

  Note that this was unnoticed, as the code part was never hit so far in the test framework.

ACKs for top commit:
  achow101:
    ACK 3e9c736a26
  Christewart:
    ACK 3e9c736a26
  rkrux:
    tACK [3e9c736](3e9c736a26)
  hernanmarino:
    tACK 3e9c736a26

Tree-SHA512: 51647bb6d462fbd101effd851afdbd6ad198c0567888cd4fdcac389a9fb4bd3d7e648095c6944fd8875d36272107ebaabdc62d0e2423289055588c12294d05a7
2024-04-25 13:51:39 -04:00
..
crypto
__init__.py
address.py
authproxy.py
bdb.py
bip340_test_vectors.csv
blockfilter.py
blocktools.py
coverage.py
descriptors.py
key.py
messages.py
netutil.py
p2p.py test: Extends wait_for_getheaders so a specific block hash can be checked 2024-04-04 13:36:45 +02:00
psbt.py
script.py
script_util.py
segwit_addr.py
socks5.py
test_framework.py Merge bitcoin/bitcoin#29498: test: Update --tmpdir doc string to say directory must not exist 2024-04-09 09:43:28 +02:00
test_node.py
test_shell.py
util.py fixup: get all utxos up front in fill_mempool, discourage wallet mixing 2024-04-15 18:22:32 +02:00
v2_p2p.py
wallet.py
wallet_util.py Fix typos in description.md and wallet_util.py 2024-04-25 16:14:10 +08:00