aboutsummaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2018-09-18Merge #13152: [rpc] Add getnodeaddresses RPC commandMarcoFalke
a2eb6f5405 [rpc] Add getnodeaddresses RPC command (chris-belcher) Pull request description: Implements issue https://github.com/bitcoin/bitcoin/issues/9463 New getnodeaddresses call gives access via RPC to the peers known by the node. It may be useful for bitcoin wallets to broadcast their transactions over tor for improved privacy without using the centralized DNS seeds. getnodeaddresses is very similar to the getaddr p2p method. Please advise me on the best approach for writing an automated test. By my reading the getaddr p2p method also isn't really tested. Tree-SHA512: ad03abf518847476495b76a2f5394b8030aa86654429167fa618e21460abb505c10ef9817ec1b80472320d41d0aff5dc94a8efce023aaaaf5e81386aa92b852b
2018-09-17[rpc] Add getnodeaddresses RPC commandchris-belcher
New getnodeaddresses call gives access via RPC to the peers known by the node. It may be useful for bitcoin wallets to broadcast their transactions over tor for improved privacy without using the centralized DNS seeds. getnodeaddresses is very similar to the getaddr p2p method. Tests the new rpc call by feeding IP address to a test node via the p2p protocol, then obtaining someone of those addresses with getnodeaddresses and checking that they are a subset.
2018-09-17[qa] Test for duplicate inputs within a transactionSuhas Daftuar
2018-09-17Changed functional tests which do not require wallets to run withoutsanket1729
skipping .Addreses #14216. Changed get_deterministic_priv_key() to a named tuple
2018-09-16tests: Reorder tests and move most of extended tests up to normal testsChun Kuan Lee
2018-09-14Merge #12493: [wallet] Reopen CDBEnv after encryption instead of shutting downWladimir J. van der Laan
c1dde3a949b36ce9c2155777b3fa1372e7ed97d8 No longer shutdown after encrypting the wallet (Andrew Chow) d7637c5a3f1d62922594cdfb6272e30dacf60ce9 After encrypting the wallet, reload the database environment (Andrew Chow) 5d296ac810755dc47f105eb95b52b7e2bcb8aea8 Add function to close all Db's and reload the databae environment (Andrew Chow) a769461d5e37ddcb771ae836254fdc69177a28c4 Move BerkeleyEnvironment deletion from internal method to callsite (Andrew Chow) Pull request description: This is the replacement for #11678 which implements @ryanofsky's [suggestion](https://github.com/bitcoin/bitcoin/pull/11678#pullrequestreview-76464511). Shutting down the software was to prevent the BDB environment from writing unencrypted private keys to disk in the database log files, as was noted [here](https://bitcointalk.org/index.php?topic=51474.msg616068#msg616068). This PR replaces the shutdown behavior with a CDBEnv flush, close, and reopen which achieves the same effect: everything is cleanly flushed and closed, the log files are removed, and then the environment reopened to continue normal operation. To ensure that no unencrypted private keys are in the log files after encrypting the wallet, I wrote [this script](https://gist.github.com/achow101/7f7143e6c3d3fdc034d3470e72823e9d) to pull private keys from the original wallet file and searches for these keys in the log files (note that you will have to change your file paths to make it work on your own machine). As for concerns about private keys being written to slack space or being kept in memory, these behaviors no longer exist after the original wallet encryption PR and the shutting down solution from 2011. cc @ryanofsky Tree-SHA512: 34b894283b0677a873d06dee46dff8424dec85a2973009ac9b84bcf3d22d05f227c494168c395219d9aee3178e420cf70d4b3eeacc9785aa86b6015d25758e75
2018-09-13Merge #14215: [qa] Use correct python index slices in example testMarcoFalke
9dcb6763fb [qa] Use correct python index slices in example test (Suhas Daftuar) Pull request description: There's an off-by-one in the list indices used in example_test.py. Tree-SHA512: d75b77c1e0b3931d02dfa043da4cb6fe8e62864a73717ce5c184d9dbeb25579342c6365cc7bbcc7c4382d76a320a528bf3c69107854dfc6fa704133d0ba11012
2018-09-13Merge #14179: qa: Fixups to "Run all tests even if wallet is not compiled"MarcoFalke
fa8433e379 qa: Remove unneded import_deterministic_coinbase_privkeys overwrite, add comments (MarcoFalke) e413c2ddd1 qa: Fix codespell error and have lint-spelling error instead of warn (MarcoFalke) Pull request description: Currently the functional tests require the wallet module to be compiled into the Bitcoin Core executable. For example the premine (or datadir cache) to speed up tests when run in parallel would mine a bunch of blocks and store the private keys to sign the coinbase tx outputs in a wallet. There is no need to have the overhead of the whole wallet module by using keys that are deterministic for all runs. Note that this change most likely requires the `./test/cache/` to be cleared. Tree-SHA512: 9ce26036b0e10f0f888f66a1e50be6a357343f9ffb302ae24a7bb3df2f083a31702ef308b738a03b08a1b623aeddac5d6563dc1b15078c0357b7dafad7808ec3
2018-09-13[qa] Use correct python index slices in example testSuhas Daftuar
2018-09-13Merge #13983: rpc: Return more specific reject reason for submitblockMarcoFalke
fa6ab8ada1 rpc: Return more specific reject reason for submitblock (MarcoFalke) Pull request description: The second commit in #13439 made the `TODO` in the first commit impossible to solve. The meaning of `fNewBlock` changed from "This is the first time we process this block" to "We are about to write the new *valid* block". So whenever `fNewBlock` is true, the block was valid. And whenever the `fNewBlock` is false, the block is either valid or invalid. If it was valid and not new, we know it is a `"duplicate"`. In all other cases, the `BIP22ValidationResult()` will return the reason why it is invalid. Tree-SHA512: 4b6edf7a912339c3acb0fccfabbdd6d812a0321fb1639c244c2714e58dc119aa2b8c6bf8f7d61ea609a1b861bbc23f920370fcf989c48452721e259a8ce93d24
2018-09-13qa: Remove unneded import_deterministic_coinbase_privkeys overwrite, add ↵MarcoFalke
comments
2018-09-13qa: Fix codespell error and have lint-spelling error instead of warnMarcoFalke
2018-09-13Merge #14199: [psbt]Remove redundant BIP174 test from rpc_psbt.jsonWladimir J. van der Laan
b6a253337f6371e4aa27c488ad70741d2b750d01 Remove redundant BIP174 test from rpc_psbt.json (araspitzu) Pull request description: There was a duplicate test for SIGNER role inside 'test/functional/data/rpc_psbt.json', namely test number 2 was equal to test number 3 in the array of data for 'signer'. This pull request removes the 3rd (redundant) test. Tree-SHA512: e2128c93183f2e0acf5247274397c77a962accf95dee3bb6f785494cf3080a3f28ea47d8209e36b3064490c821690d1742c22e0d76370cb1688dcb2ab91d8f57
2018-09-13Merge #14180: qa: Run all tests even if wallet is not compiledWladimir J. van der Laan
fac95398366f644911b58f1605e6bc37fb76782d qa: Run all tests even if wallet is not compiled (MarcoFalke) faa669cbcd1fc799517b523b0f850e01b11bf40a qa: Premine to deterministic address with -disablewallet (MarcoFalke) Pull request description: Currently the test_runner would exit if the wallet was not compiled into the Bitcoin Core executable. However, a lot of the tests run without the wallet just fine and there is no need to globally require the wallet to run the tests. Tree-SHA512: 63177260aa29126fd20f0be217a82b10b62288ab846f96f1cbcc3bd2c52702437703475d91eae3f8d821a3149fc62b725a4c5b2a7b3657b67ffcbc81532a03bb
2018-09-12logging: Replace LogPrint macros with regular functionsMarcoFalke
2018-09-11Remove redundant BIP174 test from rpc_psbt.jsonaraspitzu
2018-09-11Merge #13734: gui: Drop boost::scoped_array and use wchar_t API explicitly ↵Wladimir J. van der Laan
on Windows bb6ca65f9890e8280ace32de5a37774e14705859 gui: get special folder in unicode (Chun Kuan Lee) 1c5d22585384c8bb05a27a04eab5c57b31d623fb Drop boost::scoped_array (Chun Kuan Lee) Pull request description: Drop boost::scoped_array and simplify the code. `TCHAR` should be defined as `wchar_t` if `UNICODE` is defined. So we can use `.toStdWString().c_str()` to get wchar_t C-style string. Fix #13819 Tree-SHA512: 3fd4aa784129c9d1576b01e6ee27faa42d793e152d132f2dde504d917dad3a8e95e065fcbc54a3895d74fb6b2a9ed4f5ec67d893395552f585e225486a84a454
2018-09-10qa: Run all tests even if wallet is not compiledMarcoFalke
2018-09-10qa: Premine to deterministic address with -disablewalletMarcoFalke
2018-09-10qa: Fix silent merge conflict in wallet_importmultiMarcoFalke
2018-09-10Merge #9332: Let wallet importmulti RPC accept labels for standard scriptPubKeysWladimir J. van der Laan
98ea64cf232c34d4b1aebe738b3956191667cd76 Let wallet importmulti RPC accept labels for standard scriptPubKeys (Russell Yanofsky) Pull request description: Allow importmulti RPC to apply address labels when importing standard scriptPubKeys. This makes the importmulti RPC less finnicky about import formats and also simpler internally. Tree-SHA512: 102426b21239f1fa5f38162dc3f4145572caef76e63906afd786b7aff1670d6cd93456f8d85f737588eedc49c11bef2e1e8019b8b2cbf6097c77b3501b0cab1f
2018-09-08Merge #14119: qa: Read reject reasons from debug log, not p2p messagesWladimir J. van der Laan
fac3e22b18cd29053bc17065fd75db7b84ba6f40 qa: Read reject reasons from debug log, not p2p messages (MarcoFalke) Pull request description: For local testing we don't need to rely on p2p messages just to assert a reject reason. Replace reading p2p messages with reading from the debug log file. Tree-SHA512: fa59598ecf5e00cfb420ef1892d90aa415501fd882e1c608894dc577b0d00e93a442326d3a9167fef77d26aafbe345b730b49109982ccad68a5942384564a90b
2018-09-06Merge #12490: [Wallet] [RPC] Remove deprecated wallet rpc features from ↵MarcoFalke
bitcoin_server f7e9e70468 [rpc] Remove deprecated sigrawtransaction rpc method. (John Newbery) 90c834089a [RPC] Remove warning about wallet addresses in createmultisig() (John Newbery) df905e390e [rpc] Remove deprecated validateaddress usage. (John Newbery) Pull request description: The following rpc features were deprecated in V0.17: - `validateaddress` returning wallet information about an address - `signrawtransaction` This PR fully removes those features. It can be merged once V0.17 has been branched from master. Tree-SHA512: 28293d218cf7e348632081e362f8775f243d091f49aed54c354f017d4a12ae92b87b99f81ee592a1bbf4aebd5d8cd5119278141edde7a0399ff82917ed68b9f6
2018-09-06Merge #14105: util: Report parse errors in configuration fileWladimir J. van der Laan
ed2332aeffb071a3404be9cff8f9fb8a81a9fbfb test: Add test for config file parsing errors (MarcoFalke) a66c0f78a941968340f030911765a84219908c4d util: Report parse errors in configuration file (Wladimir J. van der Laan) Pull request description: Report errors while parsing the configuration file, instead of silently ignoring them. $ src/bitcoind -regtest Error reading configuration file: parse error on line 22: nodebuglogfile, if you intended to specify a negated option, use nodebuglogfile=1 instead $ src/bitcoind -regtest Error reading configuration file: parse error on line 22: sdafsdfafs $ src/bitcoind -regtest Error reading configuration file: parse error on line 24: -nodebuglogfile=1, options in the configuration file must be specified without leading - (inspired by https://github.com/bitcoin/bitcoin/pull/14100#issuecomment-417264823) Tree-SHA512: d516342b65db2969edf200390994bbbda23654c648f85dcc99f9f2d217d3d59a72e0f58227be7b4746529dcfa54ba26d8188ba9f14a57c9ab00015d7283fade2
2018-09-06test: Add test for config file parsing errorsMarcoFalke
2018-09-05Merge #13954: Warn (don't fail!) on spelling errors. Fix typos reported by ↵MarcoFalke
codespell. f8a81f73ac lint: Add spell check linter (codespell) (practicalswift) ada356208e Fix typos reported by codespell (practicalswift) Pull request description: * Check for common misspellings using `codespell`. * Fix recently introduced typos reported by `codespell`. Tree-SHA512: 9974c0e640b411c7d0ebc5b45de253c19bac7fe3002cd98601ff8da8db584224c2fd7d331aee3df612c9f2cfef540d647a9b4c5a1a73fd208dc93ce4bf9e5e3e
2018-09-05Merge #14115: lint: Make all linters work under the default macOS dev ↵MarcoFalke
environment (build-osx.md) 341f7c7b0e macOS fix: Check for correct version of flake8 to avoid spurious warnings. The brew installed flake8 version is Python 2 based and does not work. (practicalswift) 908a559f33 macOS fix: Add excludes for checks added in the newer shellcheck version installed by brew (practicalswift) ec4d57bbb3 macOS fix: Work around empty (sub)expression error when using BSD grep (practicalswift) b57d7d92fe macOS fix: Avoid mapfile due to ancient version of bash shipped with macOS (practicalswift) Pull request description: The linters are thoroughly tested under Ubuntu which is what we use in Travis. When reading #14041 I understood that some developers were experiencing problems when running the linters on their local machines. Assuming these local machines were running macOS I installed a fresh macOS VM, followed the instructions in `build-osx.md` and ran the linters. This PR contains the changes needed to make `lint-all.sh` run as expected. Ideally the linters would continuously run also under a Travis macOS environment to make sure we catch these kind of issues before merge. Tree-SHA512: b39c9a970d14d27db1fb592539923c0bc676b5217f415d02fda3f17bf54d46faa172376e8a3ecab07ca68a3acba9aebe00b2b1b2161b2a36b85fbb672e7efb5c
2018-09-04lint: Add spell check linter (codespell)practicalswift
2018-09-04Fix typos reported by codespellpracticalswift
2018-09-04Merge #14128: lint: Make sure we read the command line inputs using utf-8 ↵Wladimir J. van der Laan
decoding in python 5d62dcf9cfb5c0b2511c10667ed47ec3b3610d72 lint: Make sure we read the command line inputs using utf-8 decoding in python (Chun Kuan Lee) Pull request description: Make sure we read the command line inputs using utf-8 decoding in python occurred from travis cron job: contrib/verify-commits/verify-commits.py should run with utf-8, otherwise it would raise UnicodeDecodeError `UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 744: ordinal not in range(128)` Tree-SHA512: 90e4ad57fdbbbecb0a21fc2d2b03a04f5ef125e54124719ef36e5a85326930b732b47534757a7c3a8730096f3947b009ec898191928b5c2d38f9f4b3e37db48d
2018-09-02lint: Make sure we read the command line inputs using utf-8 decoding in pythonChun Kuan Lee
2018-09-01Test rpc_help.py failed: Check whether ZMQ is enabled or not.Kvaciral
2018-08-31qa: Read reject reasons from debug log, not p2p messagesMarcoFalke
2018-08-31Merge #14088: tests: Don't assert(...) with side effectsWladimir J. van der Laan
ca1a093127c11bb2aea10bf96c38dbfb40f8d170 Add regression test: Don't assert(...) with side effects (practicalswift) 4c3c9c38699360f93d3c52a01a90ff15ee5e1a62 Don't assert(...) with side effects (practicalswift) Pull request description: Don't `assert(...)` with side effects. From the developer notes: > **Assertions should not have side-effects** > > Rationale: Even though the source code is set to refuse to compile with assertions disabled, having side-effects in assertions is unexpected and makes the code harder to understand These assertions were introduced quite recently (in #14069 which was merged two days ago) and since this is a recurring thing (see #13534 – "Don't assert(foo()) where foo() has side effects" from May) I added a simple regression test for the most obvious common side effect. Tree-SHA512: be65db9d8d5d0f5752152ba73fe3fbb0531880f156d3cd7dfdf1752709979b63214e46ae64b1adbe1e09fa121278f4087f4ae49bff16cf8f5aec16ea6bde3650
2018-08-31macOS fix: Check for correct version of flake8 to avoid spurious warnings. ↵practicalswift
The brew installed flake8 version is Python 2 based and does not work.
2018-08-31macOS fix: Add excludes for checks added in the newer shellcheck version ↵practicalswift
installed by brew
2018-08-31macOS fix: Work around empty (sub)expression error when using BSD greppracticalswift
2018-08-31macOS fix: Avoid mapfile due to ancient version of bash shipped with macOSpracticalswift
2018-08-29qa: Use named args in some testsMarcoFalke
2018-08-29scripted-diff: Use named arguments in feature_blockMarcoFalke
-BEGIN VERIFY SCRIPT- sed -i --regexp-extended -e "s/sync_blocks\((.*?), (True|False), (1.?), /sync_blocks(\1, success=\2, reject_code=\3, reject_reason=/g" ./test/functional/feature_block.py -END VERIFY SCRIPT-
2018-08-29scripted-diff: Pass node into p2p_segwit acceptance testsMarcoFalke
-BEGIN VERIFY SCRIPT- sed -i --regexp-extended -e 's/(test_witness_block|test_transaction_acceptance)\((self\.nodes\[.\])\.rpc/\1(\2/g' test/functional/p2p_segwit.py -END VERIFY SCRIPT-
2018-08-29Merge #14020: Add tests for RPC helpMarcoFalke
6af6d9b23d test: Add tests for RPC help (João Barbosa) Pull request description: At the moment the new test checks for: - invalid usages - expected output for unknown command - current RPC command titles (derived from command categories) — this prevents adding wrong RPC categories and new categories must be added to the test Tree-SHA512: f987535d001b1cd300656588602b1634099ea68a1dd2282180c30fa56caf7f990be9e2dc86c7431dfcf7fd686d0299a8d4935df178a2c9f0fb6fbebcba748eb5
2018-08-29Merge #13671: Remove the boost/algorithm/string/case_conv.hpp dependencyWladimir J. van der Laan
b193d5a443bfd994936ad21b807b2bb37756ef2c Removes the Boost case_conv.hpp dependency. (251) 7a208d9fade56e2347891daff2f6b903923c9d50 Implements custom tolower and toupper functions. (251) e2ba043b8d852d3f465bc293d6e494c8c6f75dfd Implements ParseNetwork unit test. (251) Pull request description: This pull request removes the `boost/algorithm/string/case_conv.hpp` dependency from the project. `boost/algorithm/string/case_conv.hpp` is included for the `boost::to_lower` and `boost::to_upper` template functions. We can replace the calls to these functions with straightforward alternative implementations that use the C++ Standard Library, because the functions are called with `std::string` objects that use standard 7-bit ASCII characters as argument. The refactored implementation should work without the explicit `static_cast<unsigned char>` cast and `unsigned char` lambda return type. Both have been added defensively and to be explicit. Especially in case of the former, behaviour is undefined (potentially result in a crash) if the `std::toupper` argument is not an `unsigned char`. A potential alternative, maybe even preferred, implementation to address the `boost::to_lower` function call in `ParseNetwork(std::string)` could have been: ```c++ if (net == "ipv4" || net == "IPv4") return NET_IPV4; if (net == "ipv6" || net == "IPv6") return NET_IPV6; ``` This alternative implementation would however change the external behaviour of `ParseNetwork(std::string)`. This pull requests includes a unit test to validate the implementation of `ParseNetwork(std::string)` prior and after the removal of the `case_conv.hpp` dependency. `boost/algorithm/string/case_conv.hpp` has been removed from the `EXPECTED_BOOST_INCLUDES` in `test/lint/lint-includes.sh` because it is no longer required. Tree-SHA512: d803ae709f2368a3efb223097384a722436955bce0c44a1a5cffd0abb3164be0cce85ba0e9ebd9408166df3f1a95ea0c0d29e3a2534af2fae206c0419d67fde9
2018-08-29Merge #13862: utils: drop boost::interprocess::file_lockWladimir J. van der Laan
1661a472b8245eb4588fedbf19c9ed07a41e7602 add unicode compatible file_lock for Windows (Chun Kuan Lee) Pull request description: boost::interprocess::file_lock cannot open the files that contain characters which cannot be parsed by the user's code page on Windows. This PR is seperated from #13426 for easier review. Tree-SHA512: e240479cda65958bf6e1319840b83928b2b50da81d99f4f002fb3b62621370bcd4bcfacd2b8c0678c443a650d6ba53d9d12618b591e5bfd67ac14388a18fd822
2018-08-28Merge #14055: fix walletcreatefundedpsbt deriv paths, add testWladimir J. van der Laan
61fe653bd919cb0533b2b9d6259bc86a4b2975c0 fix walletcreatefundedpsbt deriv paths, add test (Gregory Sanders) Pull request description: Added the regression in #13968 Tree-SHA512: a31290b57ed80a8486925e562ca5412500d4215a238de7e448f48edfa671c87aebd79ee179a8340b289d9811ae6fa30ef75eefd5f5890fb6285174c5db72ff65
2018-08-28Merge #14052: qa: Add some actual witness in rpc_rawtransactionMarcoFalke
fae040010d qa: Add some actual witness in rpc_rawtransaction (MarcoFalke) Pull request description: The transaction was serialized with the witness flag but didn't include any witness, so add some dummy witness... Tree-SHA512: fe71167c16e9b0053110be7c544e1ea08868f04ffee8d4c74887c9bcdcd5b59d5e8dd53c67e104a1bdbbf606202bc3fbef6017f402f2c75bdb2ebd9f7aabb2b1
2018-08-28Removes the Boost case_conv.hpp dependency.251
This commit removes the `boost/algorithm/string/case_conv.hpp` dependency from the project. It replaces the `boost::to_lower` and `boost::to_upper` functions with custom functions that are locale independent and ASCII deterministic.
2018-08-28Add regression test: Don't assert(...) with side effectspracticalswift
2018-08-28Merge #14051: [Tests] Make combine_logs.py handle multi-line logsWladimir J. van der Laan
16e288acdd61fa5fa5e39f3936fb50499f82c085 test padding non micro timestamps (John Newbery) 995dd89d884bda3fb5ca1885c5887d989cd2cad3 [Tests] Make combine_logs.py handle multi-line logs (John Newbery) Pull request description: combine_logs.py currently inserts additional newlines into multi-line log messages, and doesn't color them properly. Fix both of those. Tree-SHA512: dbe2f3ecc7cfbc95ee4350e648d127538c79cb6555257d4aeec12fe3d159366742b68e90e620c8ed7219a44b973395c7e5929ba374fae115fbee25560db645f6
2018-08-27[rpc] Remove deprecated sigrawtransaction rpc method.John Newbery