Skip to content

Commit

Permalink
Merge bitcoin#14305: Tests: enforce critical class instance attribut…
Browse files Browse the repository at this point in the history
…es in functional tests, fix segwit test specificity

e460232 Document fixed attribute behavior in critical test framework classes. (Justin Turner Arthur)
17b42f4 Check for specific tx acceptance failures based on script signature (Justin Turner Arthur)
3a4449e Strictly enforce instance attrs in critical functional test classes. (Justin Turner Arthur)
1d0ce94 Fix for incorrect version attr set on functional test segwit block. (Justin Turner Arthur)
ba923e3 test: Fix broken segwit test (practicalswift)

Pull request description:

  No extra attributes will be able to be added to instances of the C++ class ports or of other critical classes without causing an exception. Helps prevent adding or depending on attributes that aren't in the intended object structure. It may prevent issues such as the one fixed in bitcoin#14300.

  This request fixes the erroneous version attribute used in the p2p_segwit.py functional tests. This pull includes the commit from bitcoin#14300.

Tree-SHA512: 1b8c58e7aa0f71075ed5ff3e5be0a5182599108d8cd9bce682feac3b1842508124288e9335432b16a43f40f159c9710899e6d84af1b5868f48c947bc6f3e07ec
  • Loading branch information
MarcoFalke authored and pravblockc committed Jul 28, 2021
1 parent c1a3eb6 commit 56a1b67
Show file tree
Hide file tree
Showing 4 changed files with 118 additions and 40 deletions.
7 changes: 6 additions & 1 deletion test/functional/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ don't have test cases for.
- When calling RPCs with lots of arguments, consider using named keyword
arguments instead of positional arguments to make the intent of the call
clear to readers.
- Many of the core test framework classes such as `CBlock` and `CTransaction`
don't allow new attributes to be added to their objects at runtime like
typical Python objects allow. This helps prevent unpredictable side effects
from typographical errors or usage of the objects outside of their intended
purpose.

#### RPC and P2P definitions

Expand All @@ -76,7 +81,7 @@ P2P messages. These can be found in the following source files:

#### Using the P2P interface

- `mininode.py` contains all the definitions for objects that pass
- `messages.py` contains all the definitions for objects that pass
over the network (`CBlock`, `CTransaction`, etc, along with the network-level
wrappers for them, `msg_block`, `msg_tx`, etc).

Expand Down
Empty file added test/functional/p2p_segwit.py
Empty file.
Loading

0 comments on commit 56a1b67

Please sign in to comment.