aboutsummaryrefslogtreecommitdiff
path: root/test/functional/feature_nulldummy.py
AgeCommit message (Collapse)Author
2022-06-24test: remove wallet dependency from feature_nulldummy.pyAyush Sharma
This test can now be run even with the Bitcoin Core wallet disabled.
2021-11-17Merge bitcoin/bitcoin#23501: test: various feature_nulldummy.py improvementsW. J. van der Laan
f1ed30451f04af4b45b6368305722f715dcbf4fb test: refactor: simplify `block_submit` in feature_nulldummy.py (Sebastian Falbesoner) 5ba9f1ff598e30a70407f331fabcbe9b4e17315a test: refactor: rename NULLDUMMY-invalidation helper (Sebastian Falbesoner) e1d4a128e8c71a741c2435f949c1427929e151b7 test: simplify and document NULLDUMMY-invalidation helper (Sebastian Falbesoner) Pull request description: This PR improves the functional test `feature_nulldummy.py` by simplifying the helpers `trueDummy` (renamed to `invalidate_nulldummy_tx`) and `block_submit`. Details can be found in the commit messages. ACKs for top commit: laanwj: Code review ACK f1ed30451f04af4b45b6368305722f715dcbf4fb Tree-SHA512: ad227b31936f53c5dbded823643bced296d86f40b90f2c144a9857db3d00544f9ad5bbce4c7e84b6ece25e78e95c19aafb1d8fb31e610dcd5cbf3da63190de85
2021-11-16Merge bitcoin/bitcoin#23474: test: scripted-diff cleanups after generate* ↵fanquake
changes fac23c211407a77af82bb1491c48c8d37022c8b3 scripted-diff: Bump copyright headers (MarcoFalke) fa974f1f1417a536636347072e86bcb54a4c909c scripted-diff: Remove redundant sync_all and sync_blocks (MarcoFalke) fad13991aea6463ecf07dd907de1c1b23837d7e7 test: Properly set sync_fun in NodeNetworkLimitedTest (MarcoFalke) faeff577093c4de9eec9491486a2c3766d46dae6 test: Use 4 spaces for indentation (MarcoFalke) Pull request description: Some cleanups after commit 94db963de501e4aba6e5d8150a01ceb85753dee1 ACKs for top commit: fanquake: ACK fac23c211407a77af82bb1491c48c8d37022c8b3 Tree-SHA512: 5acfd5bb9679b41969d0fc6fc85801ccadcd6530ea692bac6352668e06fc7a9b0e1db3fd6fba435e84afe983d2eb07bd0a47c8364462bb7110004bd3d102b698
2021-11-13test: refactor: simplify `block_submit` in feature_nulldummy.pySebastian Falbesoner
The `create_block` helper accepts a list of txs that it includes in the created block, hence we don't have to do that manually. Also, rehashing before solving the block is not needed and can be removed.
2021-11-13test: refactor: rename NULLDUMMY-invalidation helperSebastian Falbesoner
The name is changed to match the coding guidelines (snake case) and to be more descriptive.
2021-11-13test: simplify and document NULLDUMMY-invalidation helperSebastian Falbesoner
The function `trueDummy` in feature_nulldummy.py is currently more complicated than it needs to be. Rather than converting the scriptSig to a CScript and looping through it to build a new scriptSig with the modified push, simply directly replace the push of null (OP_0) with a push of one (OP_TRUE/OP_1). Note that on master, actually an element with the value of 0x51 is pushed (0x0151...) -- this was very likely not intended, as 0x51 is the script op-code for OP_TRUE, and also the function's name suggests that the "true" value shall be pushed.
2021-11-12test: remove unnecessary block rehashing prior to solvingSebastian Falbesoner
Solving a block involves continously rehashing it, i.e. any extra calls to rehash it before are not necessary and can be dropped.
2021-11-10scripted-diff: Bump copyright headersMarcoFalke
The previous diff touched most files in ./test/, so bump the headers to avoid having to touch them again for a bump later. -BEGIN VERIFY SCRIPT- ./contrib/devtools/copyright_header.py update ./test/ -END VERIFY SCRIPT-
2021-09-16Introduce -testactivationheight=name@height settingMarcoFalke
2021-09-02scripted-diff: Use generate* from TestFrameworkMarcoFalke
-BEGIN VERIFY SCRIPT- sed --regexp-extended -i \ 's/((self\.)?(nodes\[[^]]+\]|[a-z_]*(wallet|node)[0-9a-z_]*))\.(generate(|toaddress|block|todescriptor)(\(|, ))/self.\5\1, /g' \ $(git grep -l generate ./test | grep -v 'test_framework/' | grep -v 'feature_rbf') -END VERIFY SCRIPT-
2021-08-23test: fix failure in feature_nulldummy.py on single-core machinesSebastian Falbesoner
On single-core machines, executing the test feature_nulldummy.py results in the following assertion error: ... 2021-08-18T15:37:58.805000Z TestFramework (INFO): Test 4: Non-NULLDUMMY base multisig transaction is invalid after activation 2021-08-18T15:37:58.814000Z TestFramework (ERROR): Assertion failed Traceback (most recent call last): File "[...]/test/functional/test_framework/test_framework.py", line 131, in main self.run_test() File "[...]/test/functional/feature_nulldummy.py", line 107, in run_test self.block_submit(self.nodes[0], [test4tx], accept=False) File "[...]/test/functional/feature_nulldummy.py", line 134, in block_submit assert_equal(None if accept else 'block-validation-failed', node.submitblock(block.serialize().hex())) File "[...]/test/functional/test_framework/util.py", line 49, in assert_equal raise AssertionError("not(%s)" % " == ".join(str(arg) for arg in (thing1, thing2) + args)) AssertionError: not(block-validation-failed == non-mandatory-script-verify-flag (Dummy CHECKMULTISIG argument must be zero)) 2021-08-18T15:37:58.866000Z TestFramework (INFO): Stopping nodes ... The behaviour can be reproduced on a multi-core machine by simply changing the function GetNumCores() (in src/util/system.cpp) to return 1: int GetNumCores() { return 1; }
2021-08-23test: refactor: use named args for block_submit in feature_nulldummy.pySebastian Falbesoner
2021-06-04test: Remove unused node from feature_nulldummyMarcoFalke
2021-05-21Move COINBASE_MATURITY from `feature_nulldummy` test to `blocktools`.Kiminuo
2021-03-10test: use 327 fewer blocks in feature_nulldummyJon Atack
by generating 100 blocks for coinbase maturity instead of 427. This speeds up the test and should help avoid timeout errors.
2021-03-10test, refactor: abstract the feature_nulldummy blockheight valuesJon Atack
Refactoring only, no change in test behavior.
2021-01-04doc: fix various typosIkko Ashimine
Co-authored-by: Peter Yordanov <ppyordanov@yahoo.com>
2020-11-01Use separate watchonly wallet for multisig in feature_nulldummy.pyAndrew Chow
Create and import the multisig into a separate watchonly wallet so that feature_nulldummy.py works with descriptor wallets. blocktools.create_raw_transaction is also updated to use multiple nodes and wallets and to use PSBT so that this test passes.
2020-09-12QA: Use GBT to get block versions correctLuke Dashjr
2020-04-22test: Check submitblock return valuesMarcoFalke
2020-04-16scripted-diff: Bump copyright headersMarcoFalke
-BEGIN VERIFY SCRIPT- ./contrib/devtools/copyright_header.py update ./ -END VERIFY SCRIPT-
2020-02-26test: Reduce unneeded whitelist permissions in testsMarcoFalke
2019-10-10[logging] Don't log REJECT code when transaction is rejectedJohn Newbery
Remove the BIP61 REJECT code from error messages and logs when a transaction is rejected. BIP61 support was removed from Bitcoin Core in fa25f43ac5692082dba3f90456c501eb08f1b75c. The REJECT codes will be removed from the codebase entirely in the following commit.
2019-08-14[Consensus] Bury segwit deploymentJohn Newbery
Hardcode segwit deployment height to 481824 for mainnet.
2019-05-08test: Remove True argument to CBlock::serializeMarcoFalke
Unnamed arguments are confusing as to what they mean without looking up the function signature. Since segwit is active by default in regtest, and all blocks are serialized with witness (#15664, c459c5f), remove the argument `with_witness=True` from all calls to `CBlock::serialize` and `BlockTransactions::serialize`. This diff has been created with a script, but is better reviewed without a scripted diff. sed -i --regexp-extended -e 's/block(_?[2a-z]*)\.serialize\([a-z_]*=?True/block\1.serialize(/g' $(git grep -l serialize ./test)
2019-03-14wallet/rpc: add maxfeerate parameter to sendrawtransactionKarl-Johan Alm
2019-03-02scripted-diff: Update copyright in ./testMarcoFalke
-BEGIN VERIFY SCRIPT- ./contrib/devtools/copyright_header.py update ./test/ -END VERIFY SCRIPT-
2019-03-02scripted-diff: test: Remove brackets after assertMarcoFalke
-BEGIN VERIFY SCRIPT- sed -i --regexp-extended -e 's/assert ?\((.+)\)(( )*)?(#.*)?$/assert \1\3\3\4/g' $(git grep -l --extended-regexp 'assert ?\(' test) -END VERIFY SCRIPT-
2019-03-02scripted-diff: test: Use py3.5 bytes::hex() methodMarcoFalke
-BEGIN VERIFY SCRIPT- sed -i -e "s/def bytes_to_hex_str/def b_2_x/g" $(git grep -l bytes_to_hex_str) export RE_B_0="[^()]*" # match no bracket export RE_B_1="${RE_B_0}\(${RE_B_0}\)${RE_B_0}" # match exactly one () export RE_B_2="${RE_B_0}\(${RE_B_1}\)${RE_B_0}" # match wrapped (()) export RE_M="(b2x|bytes_to_hex_str)\(((${RE_B_0}|${RE_B_1}|${RE_B_2})*)\)" sed -i --regexp-extended -e "s/${RE_M}/\2.hex()/g" $(git grep -l -E '(b2x|bytes_to_hex_str)') sed -i --regexp-extended -e "/ +bytes_to_hex_str( as b2x)?,/d" $(git grep -l bytes_to_hex_str) sed -i --regexp-extended -e "s/ +bytes_to_hex_str( as b2x)?,//g" $(git grep -l bytes_to_hex_str) sed -i --regexp-extended -e "s/, bytes_to_hex_str( as b2x)?//g" $(git grep -l bytes_to_hex_str) export RE_M="(binascii\.)?hexlify\(((${RE_B_0}|${RE_B_1}|${RE_B_2})*)\).decode\(${RE_B_0}\)" sed -i --regexp-extended -e "s/${RE_M}/\2.hex()/g" $(git grep -l hexlify -- ':(exclude)share') sed -i --regexp-extended -e "/from binascii import hexlify$/d" $(git grep -l hexlify -- ':(exclude)share') sed -i --regexp-extended -e "s/(from binascii import) .*hexlify/\1 unhexlify/g" $(git grep -l hexlify -- ':(exclude)share') sed -i -e 's/ignore-names "/ignore-names "b_2_x,/g' ./test/lint/lint-python-dead-code.sh -END VERIFY SCRIPT-
2018-09-23[tests] Remove deprecated addwitnessaddress call from feature_nulldummyJohn Newbery
addwitnessaddress is deprecated. Replace the call to addwitnessaddress with a call to getnewaddress(address_type='p2sh-segwit')
2018-09-23[test] Fix flake8 warnings in testsJohn Newbery
Fix all flake8 warnings in tests that are about to be updated to remove addwitnessaddress
2018-09-10qa: Run all tests even if wallet is not compiledMarcoFalke
2018-08-13Merge #13054: tests: Enable automatic detection of undefined names in Python ↵MarcoFalke
tests scripts. Remove wildcard imports. 68400d8b96 tests: Use explicit imports (practicalswift) Pull request description: Enable automatic detection of undefined names in Python tests scripts. Remove wildcard imports. Wildcard imports make it unclear which names are present in the namespace, confusing both readers and many automated tools. An additional benefit of not using wildcard imports in tests scripts is that readers of a test script then can infer the rough testing scope just by looking at the imports. Before this commit: ``` $ contrib/devtools/lint-python.sh | head -10 ./test/functional/feature_rbf.py:8:1: F403 'from test_framework.util import *' used; unable to detect undefined names ./test/functional/feature_rbf.py:9:1: F403 'from test_framework.script import *' used; unable to detect undefined names ./test/functional/feature_rbf.py:10:1: F403 'from test_framework.mininode import *' used; unable to detect undefined names ./test/functional/feature_rbf.py:15:12: F405 bytes_to_hex_str may be undefined, or defined from star imports: test_framework.mininode, test_framework.script, test_framework.util ./test/functional/feature_rbf.py:17:58: F405 CScript may be undefined, or defined from star imports: test_framework.mininode, test_framework.script, test_framework.util ./test/functional/feature_rbf.py:25:13: F405 COIN may be undefined, or defined from star imports: test_framework.mininode, test_framework.script, test_framework.util ./test/functional/feature_rbf.py:26:31: F405 satoshi_round may be undefined, or defined from star imports: test_framework.mininode, test_framework.script, test_framework.util ./test/functional/feature_rbf.py:26:60: F405 COIN may be undefined, or defined from star imports: test_framework.mininode, test_framework.script, test_framework.util ./test/functional/feature_rbf.py:30:41: F405 satoshi_round may be undefined, or defined from star imports: test_framework.mininode, test_framework.script, test_framework.util ./test/functional/feature_rbf.py:30:68: F405 COIN may be undefined, or defined from star imports: test_framework.mininode, test_framework.script, test_framework.util $ ``` After this commit: ``` $ contrib/devtools/lint-python.sh | head -10 $ ``` Tree-SHA512: 3f826d39cffb6438388e5efcb20a9622ff8238247e882d68f7b38609877421b2a8e10e9229575f8eb6a8fa42dec4256986692e92922c86171f750a0e887438d9
2018-08-13tests: Use explicit importspracticalswift
2018-08-09qa: blocktools enforce named args for amountMarcoFalke
2018-08-09[Tests] Cleanup extra instances of create_transactionConor Scott
2018-07-27Update copyright headers to 2018DrahtBot
2018-06-25qa: Avoid start/stop of the network thread mid-testMarcoFalke
2018-05-29policy: Treat segwit as always activeMarcoFalke
2018-02-17scripted-diff: change signrawtransaction to signrawtransactionwithwallet in ↵Andrew Chow
tests -BEGIN VERIFY SCRIPT- sed -i 's/\<signrawtransaction\>/signrawtransactionwithwallet/g' test/functional/*.py sed -i 's/\<signrawtransaction\>/signrawtransactionwithwallet/g' test/functional/test_framework/*.py -END VERIFY SCRIPT-
2018-02-08Consistently use FormatStateMessage in RPC error outputBen Woosley
This will include the error code and debug output as well as the reason string. See #11955 for the motivation.
2018-01-25[tests] Rename feature_* functional tests.Anthony Towns