Commit graph

16815 commits

Author SHA1 Message Date
MarcoFalke
83c7533eb1
Merge #12849: Tests: Add logging in loops in p2p_sendhears.py
8dd547d82b Adding logging for loop iteration level in p2p_sendheaders.py (ccdle12)

Pull request description:

  PR for #12453

  New contributor looking at mainly the 'good first issues'.

  From my understanding of the issue:
   * Track the iteration level of loop when test fails in Travis CI

  Further clarification on the issue would be greatly appreciated to narrow down what can be fixed or updated.

Tree-SHA512: 228524aad54c09979d990a0fc6818e13a11e1ab5e78b606b892e897bba7b1e09bf25447feb631049e45ac017eeb61fbf1c1f11e8bd5103648f976a05099ba9f9
2018-04-07 10:33:55 -04:00
Wladimir J. van der Laan
69310a342f
Merge #12766: [Tests] Tidy up REST interface functional tests
55efc1f [tests] simplify binary and hex response parsing in interface_rest.py (Roman Zeyde)
ade5964 [tests] only use 2 nodes in interface_rest.py (John Newbery)
ad00fbe [tests] refactor interface_rest.py to avoid code repetition (John Newbery)
7a3181a [tests] Make json request building more consistent in interface_rest.py (John Newbery)
3fd4490 [tests] improve logging and documentation in interface_rest.py (John Newbery)
abf190e [tests] fix flake8 warnings in interface_rest.py test (John Newbery)

Pull request description:

  Following the comment at https://github.com/bitcoin/bitcoin/pull/12717#pullrequestreview-106189117.

Tree-SHA512: b55560f0d8f3069584f5a2398285483a0a23514b2b2bd2c1ced2db1cb30dc24f60f720d0fa4de30259f7918d3178d94680ae9321649544d1d04d687a2e672559
2018-04-07 16:15:35 +02:00
Wladimir J. van der Laan
9abdb7c67e
Merge #12836: Make WalletInitInterface and DummyWalletInit private, fix nullptr deref
d894894 wallet: Refactor to WalletInitInterface* const g_wallet_init_interface (João Barbosa)
39bc2fa wallet: Make WalletInitInterface and DummyWalletInit private (João Barbosa)

Pull request description:

  Implementations of `WalletInitInterface` don't have to be public, so make them private. This makes the interface instantiation static. Also reduces `ENABLE_WALLET` usage and removes the unnecessary `src/wallet/init.h` header.

Tree-SHA512: 203c49d8c85252d1bd0ff1d7ed8bcdc842d12d2d396e965cc70be5c8159a62e98ec23d32d2f3dc48a53e575844130d0a7dedac3cc2fe4621d31319b7a1c9ba89
2018-04-07 13:54:09 +02:00
Russell Yanofsky
17780d6f35 scripted-diff: Avoid interface keyword to fix windows gitian build
Rename `interface` to `interfaces`

Build failure reported by Chun Kuan Lee <ken2812221@gmail.com>
https://github.com/bitcoin/bitcoin/pull/10244#issuecomment-379434756

-BEGIN VERIFY SCRIPT-

git mv src/interface src/interfaces
ren() { git grep -l "$1" | xargs sed -i "s,$1,$2,g"; }
ren interface/            interfaces/
ren interface::           interfaces::
ren BITCOIN_INTERFACE_    BITCOIN_INTERFACES_
ren "namespace interface" "namespace interfaces"

-END VERIFY SCRIPT-
2018-04-07 03:42:02 -04:00
practicalswift
d1b622b5a2 tests: Add check for test suite name uniqueness in lint-tests.sh 2018-04-06 16:29:14 +02:00
practicalswift
dc8067b3e6 tests: Add note about uniqueness requirement for test suite names 2018-04-06 16:29:14 +02:00
MarcoFalke
3ebfb2dadb tests: Avoid test suite name collision in wallet crypto_tests 2018-04-06 16:29:14 +02:00
practicalswift
01189ab9ae build: Show enabled sanitizers in configure output 2018-04-06 11:08:20 +02:00
practicalswift
b119e78733 docs: Fix conflicting statements about initialization in developer notes 2018-04-05 23:25:07 +02:00
João Barbosa
d894894aab wallet: Refactor to WalletInitInterface* const g_wallet_init_interface 2018-04-05 21:09:22 +01:00
João Barbosa
39bc2faa2e wallet: Make WalletInitInterface and DummyWalletInit private 2018-04-05 21:09:21 +01:00
Anthony Towns
77a733a99a [tests] Add additional unit tests for -nofoo edge cases 2018-04-06 04:46:39 +10:00
Anthony Towns
af173c2bec [tests] Check GetChainName works with config entries 2018-04-06 04:46:32 +10:00
Anthony Towns
fa27f1c23e [tests] Add unit tests for ReadConfigStream 2018-04-06 04:46:32 +10:00
Anthony Towns
087c5d2040 ReadConfigStream: assume the stream is good 2018-04-06 04:46:32 +10:00
Anthony Towns
6d5815aad0 Separate out ReadConfigStream from ReadConfigFile 2018-04-06 04:46:32 +10:00
Anthony Towns
834d303415 [tests] Add unit tests for GetChainName 2018-04-06 04:46:23 +10:00
Anthony Towns
11b6b5b86e Move ChainNameFromCommandLine into ArgsManager and rename to GetChainName 2018-04-06 04:46:02 +10:00
Wladimir J. van der Laan
5f0c6a7b0e
Merge #10244: Refactor: separate gui from wallet and node
9960137 Add developer notes about blocking GUI code (Russell Yanofsky)
9a61eed Use WalletBalances struct in Qt (Russell Yanofsky)
56f33ca Remove direct bitcoin calls from qt/sendcoinsdialog.cpp (Russell Yanofsky)
e872c93 Remove direct bitcoin access from qt/guiutil.cpp (Russell Yanofsky)
5884558 Remove direct bitcoin calls from qt transaction table files (Russell Yanofsky)
3cab2ce Remove direct bitcoin calls from qt/paymentserver.cpp (Russell Yanofsky)
3ec2ebc Remove direct bitcoin calls from qt/addresstablemodel.cpp (Russell Yanofsky)
827de03 Remove direct bitcoin calls from qt/coincontroldialog.cpp (Russell Yanofsky)
a0704a8 Remove most direct bitcoin calls from qt/walletmodel.cpp (Russell Yanofsky)
90d4640 Remove direct bitcoin calls from qt/optionsdialog.cpp (Russell Yanofsky)
582daf6 Remove direct bitcoin calls from qt/rpcconsole.cpp (Russell Yanofsky)
3034a46 Remove direct bitcoin calls from qt/bantablemodel.cpp (Russell Yanofsky)
e0b66a3 Remove direct bitcoin calls from qt/peertablemodel.cpp (Russell Yanofsky)
d7c2c95 Remove direct bitcoin calls from qt/intro.cpp (Russell Yanofsky)
fe6f27e Remove direct bitcoin calls from qt/clientmodel.cpp (Russell Yanofsky)
5fba3af Remove direct bitcoin calls from qt/splashscreen.cpp (Russell Yanofsky)
c2f672f Remove direct bitcoin calls from qt/utilitydialog.cpp (Russell Yanofsky)
3d619e9 Remove direct bitcoin calls from qt/bitcoingui.cpp (Russell Yanofsky)
c0f2756 Remove direct bitcoin calls from qt/optionsmodel.cpp (Russell Yanofsky)
71e0d90 Remove direct bitcoin calls from qt/bitcoin.cpp (Russell Yanofsky)
ea73b84 Add src/interface/README.md (Russell Yanofsky)

Pull request description:

  This is a refactoring PR that does not change behavior in any way. This change:

  1. Creates abstract [`Node`](https://github.com/ryanofsky/bitcoin/blob/pr/ipc-local/src/interface/node.h) and [`Wallet`](https://github.com/ryanofsky/bitcoin/blob/pr/ipc-local/src/interface/wallet.h) interfaces in [`src/interface/`](https://github.com/ryanofsky/bitcoin/tree/pr/ipc-local/src/interface)
  1. Updates Qt code to call the new interfaces. This largely consists of diffs of the form:

  ```diff
  -    InitLogging();
  -    InitParameterInteraction();
  +    node.initLogging();
  +    node.initParameterInteraction();
  ```

  This change allows followup PR #10102 (makes `bitcoin-qt` control `bitcoind` over an IPC socket) to work without any significant updates to Qt code. Additionally:

  * It provides a single place to describe the interface between GUI and daemon code.
  * It can make better GUI testing possible, because Node and Wallet objects have virtual methods that can be overloaded for mocking.
  * It can be used to help make the GUI more responsive (see https://github.com/bitcoin/bitcoin/issues/10504)

  Other notes:

  * I used python scripts [hide-globals.py](https://github.com/ryanofsky/home/blob/master/src/2017/hide-globals/hide-globals.py) and [replace-syms.py](https://github.com/ryanofsky/home/blob/master/src/2017/hide-globals/replace-syms.py) to identify all the places where Qt code was accessing libbitcoin global variables and calling functions accessing those global variables.
  * These changes were originally part of #10102. Thanks to @JeremyRubin for the suggestion of splitting them out.

  Commits:

  - [`ea73b84d2d` Add src/interface/README.md](ea73b84d2d)
  - [`71e0d90876` Remove direct bitcoin calls from qt/bitcoin.cpp](71e0d90876)
  - [`c0f2756be5` Remove direct bitcoin calls from qt/optionsmodel.cpp](c0f2756be5)
  - [`3d619e9d36` Remove direct bitcoin calls from qt/bitcoingui.cpp](3d619e9d36)
  - [`c2f672fb19` Remove direct bitcoin calls from qt/utilitydialog.cpp](c2f672fb19)
  - [`5fba3af21e` Remove direct bitcoin calls from qt/splashscreen.cpp](5fba3af21e)
  - [`fe6f27e6ea` Remove direct bitcoin calls from qt/clientmodel.cpp](fe6f27e6ea)
  - [`d7c2c95948` Remove direct bitcoin calls from qt/intro.cpp](d7c2c95948)
  - [`e0b66a3b7c` Remove direct bitcoin calls from qt/peertablemodel.cpp](e0b66a3b7c)
  - [`3034a462a5` Remove direct bitcoin calls from qt/bantablemodel.cpp](3034a462a5)
  - [`582daf6d22` Remove direct bitcoin calls from qt/rpcconsole.cpp](582daf6d22)
  - [`90d4640b7e` Remove direct bitcoin calls from qt/optionsdialog.cpp](90d4640b7e)
  - [`a0704a8996` Remove most direct bitcoin calls from qt/walletmodel.cpp](a0704a8996)
  - [`827de038ab` Remove direct bitcoin calls from qt/coincontroldialog.cpp](827de038ab)
  - [`3ec2ebcd9b` Remove direct bitcoin calls from qt/addresstablemodel.cpp](3ec2ebcd9b)
  - [`3cab2ce5f9` Remove direct bitcoin calls from qt/paymentserver.cpp](3cab2ce5f9)
  - [`58845587e1` Remove direct bitcoin calls from qt transaction table files](58845587e1)
  - [`e872c93ee8` Remove direct bitcoin access from qt/guiutil.cpp](e872c93ee8)
  - [`56f33ca349` Remove direct bitcoin calls from qt/sendcoinsdialog.cpp](56f33ca349)
  - [`9a61eed1fc` Use WalletBalances struct in Qt](9a61eed1fc)
  - [`9960137697` Add developer notes about blocking GUI code](9960137697)

Tree-SHA512: 7b9eff2f37d4ea21972d7cc6a3dbe144248595d6c330524396d867f3cd2841d666cdc040fd3605af559dab51b075812402f61d628d16cf13719335c1d8bf8ed3
2018-04-05 18:19:35 +02:00
Pieter Wuille
9272d70536 Support serializing Span<unsigned char> and use that instead of FLATDATA 2018-04-05 08:20:37 -07:00
Pieter Wuille
833bc08583 Add Slice: a (pointer, size) array view that acts like a container 2018-04-05 08:20:37 -07:00
practicalswift
f63bc5e063 wallet: Initialize m_last_block_processed to nullptr. Initialize fields where defined. 2018-04-05 15:49:30 +02:00
Wladimir J. van der Laan
2b54155a45
Merge #12877: doc: Use bitcoind in Tor documentation
a5263fb doc: Use bitcoind in Tor documentation (Indospace.io)

Pull request description:

Tree-SHA512: 9440bb4dc3d4e43332d7e10bbba2fc88ce74f69c17777f5448556d5b0d572e3095fc284c80ba5669e02fa64c5f2fc2b911cc53c33cb67c44334afc405f2b77ba
2018-04-05 09:53:56 +02:00
Indospace.io
a5263fb511 doc: Use bitcoind in Tor documentation 2018-04-05 09:40:20 +02:00
Wladimir J. van der Laan
bd59c4395c
Merge #12859: Bugfix: Include <memory> for std::unique_ptr
a5bca13 Bugfix: Include <memory> for std::unique_ptr (Luke Dashjr)

Pull request description:

  Not sure why all these includes were missing, but it's breaking builds for some users:

  https://bugs.gentoo.org/show_bug.cgi?id=652142

  (Added to all files with a reference to `std::unique_ptr`)

Tree-SHA512: 8a2c67513ca07b9bb52c34e8a20b15e56f8af2530310d9ee9b0a69694dd05e02e7a3683f14101a2685d457672b56addec591a0bb83900a0eb8e2a43d43200509
2018-04-05 09:31:53 +02:00
Wladimir J. van der Laan
2fc94370f5
Merge #12887: [trivial] Add newlines to end of log messages.
5b10ab0 [trivial] Add newlines to end of log messages. (John Newbery)

Pull request description:

  Log messages should terminate with a '\n', or the following log will be
  written to the same line without a timestamp. Fix a couple of cases
  where the message is not terminated with a \n.

Tree-SHA512: 88677afe85c88ce9f58312430e8881916bd76bbc8cd353ff81c97b3de8356680503160992c0ef3ea192b4694e848e9ca2480dbc38fea1776903b3784497f1af6
2018-04-05 09:13:11 +02:00
Will Ayd
c9cce0a7f6 Tests: Add Metaclass for BitcoinTestFramework
BitcoinTestFramework instructs developers in its docstring to override
`set_test_params` and `run_test` in subclasses while being sure NOT to
override `__init__` and `main` . This change adds a metaclass to ensure
that developers adhere to that protocol, raising a ``TypeError`` in
instances where they have not.

closes #12835
2018-04-04 18:09:05 -07:00
MarcoFalke
9a2db3b3d5
Merge #11818: I accidentally [deliberately] killed it [the ComparisonTestFramework]
9c92c8c827 [tests] Remove Comparison Test Framework (John Newbery)
e80c640d78 [tests] Remove bip9-softforks.py (John Newbery)

Pull request description:

  Builds on #11772, #11773 and #11817. Please review those PRs first.

  Final step in #10603.

  - First commit removes bip9-softforks.py.  bip9-sofforks.py was intended to be a generic test for versionbits deployments. However, it only tests CSV activation and was not updated to test segwit activation. CSV activation is tested by bip68-112-113-p2p.py, so this test is duplicated effort. Rather than try to update it to use the BitcoinTestFramework, just remove it. (see https://github.com/btcdrak/bitcoin/pull/8 for previous discussion around the redundancy of bip9-softforks.py)
  - Second commit removes the now unused BitcoinComparisonFramework class and the comptool and blockstore modules.

Tree-SHA512: 4bb7196d521048b3b8ba95c87dde73005a1ac73d29ccbb869f11ce9a71089686e7eacd7335337853041dfbd3a5b110172b105adbada58779814d4db22b1376f5
2018-04-04 20:47:46 -04:00
Pieter Wuille
88430cbab4
Merge #12167: Make segwit failure due to CLEANSTACK violation return a SCRIPT_ERR_CLEANSTACK error code
1e747e3c1e Make segwit failure due to CLEANSTACK violation return a SCRIPT_ERR_CLEANSTACK error code. (Mark Friedenbach)

Pull request description:

  If a segwit script terminates with a stack size not equal to one, the current error code is EVAL_FALSE. This is semantically wrong, and prevents explicitly checking CLEANSTACK violations in the unit tests. This PR changes the error code (and affected unit tests) to use SCRIPT_ERROR_CLEANSTACK instead of SCRIPT_ERROR_EVAL_FALSE.

Tree-SHA512: 8f7b1650f7a23a942cde1070e3e56420be456b4a7be42515b237e95557bf2bd5e7ba9aabd213c8092bea28c165dbe73f5a3486300089aeb01e698151b42484b1
2018-04-04 17:30:24 -07:00
MarcoFalke
bfaed1ab2e
Merge #12460: Assert CPubKey::ValidLength to the pubkey's header-relevant size
f8c249ab91 Assert CPubKey::ValidLength to the pubkey's header-relevent size (Ben Woosley)

Pull request description:

  A pubkey's length is specific to its type which is indicated by its header value. GetLen returns the header-indicated length, so this change ensures that a key matches its header-indicated length.

  And replace some magic values with their constant equivalents.

Tree-SHA512: b727b39a631babe0932326396fc4d796ade8ec1e37454ff0c709ae9b78ecbd0cfdf59d84089ba8415e6efa7bc180e3cd39a14ddaf0871cbac54b96851e1b7b44
2018-04-04 17:50:32 -04:00
MarcoFalke
2106c4c64c
Merge #12853: qa: Match full plain text by default
faace13868 qa: Match full plain text by default (MarcoFalke)

Pull request description:

  Instead of escaping all full plain text error strings, just compare their strings by default.

Tree-SHA512: 42e28f55105eb947ac6af6ce4056f0ec0f701d85f1c2a38b35ab777bbdf2296bdb79639c345621b8adc03a98b28c7630ded9a67b8b04a48e2c3a49d598ecdcd7
2018-04-04 17:28:43 -04:00
MarcoFalke
dab0d6859b
Merge #12702: [wallet] [rpc] [doc] importprivkey: hint about importmulti
4e05687153 [wallet] [rpc] [doc] importprivkey: hint about importmulti (Karl-Johan Alm)

Pull request description:

  From #12701, a hint about `importmulti` inside the help for `importprivkey` seems useful.

Tree-SHA512: 09ddfd384062b4365f678167076cb9f5af1eb8f083714a20c2a9bb14fef1c886d1666196272bf09862537166d15ae89c3330cdc6836eee76cb54d137e53301df
2018-04-04 17:26:50 -04:00
MarcoFalke
648252e8ae
Merge #12851: travis: Run verify-commits only on cron jobs
fa6f12af6b travis: Run verify-commits only on cron jobs (MarcoFalke)

Pull request description:

  Since we skip travis builds on subsequent pushes (Auto Cancellation), there is no value in running verify-commits for non-cron jobs.

Tree-SHA512: a1a55c1f2877af30c1ad3ba27c7b7219317127871d49f526d2c773b21ddd022e4ad80ac4e59e690a7c91b6fed70a23a5868ee15fbf4074fd3363bc527b589c9e
2018-04-04 17:25:53 -04:00
Russell Yanofsky
9960137697 Add developer notes about blocking GUI code 2018-04-04 16:52:41 -04:00
Russell Yanofsky
9a61eed1fc Use WalletBalances struct in Qt
Suggested by John Newbery <john@johnnewbery.com>
https://github.com/bitcoin/bitcoin/pull/10244#discussion_r177504284
2018-04-04 16:52:41 -04:00
Russell Yanofsky
56f33ca349 Remove direct bitcoin calls from qt/sendcoinsdialog.cpp 2018-04-04 16:52:40 -04:00
Russell Yanofsky
e872c93ee8 Remove direct bitcoin access from qt/guiutil.cpp 2018-04-04 16:52:40 -04:00
Russell Yanofsky
58845587e1 Remove direct bitcoin calls from qt transaction table files 2018-04-04 16:52:40 -04:00
Russell Yanofsky
3cab2ce5f9 Remove direct bitcoin calls from qt/paymentserver.cpp 2018-04-04 16:52:40 -04:00
Russell Yanofsky
3ec2ebcd9b Remove direct bitcoin calls from qt/addresstablemodel.cpp 2018-04-04 16:52:40 -04:00
Russell Yanofsky
827de038ab Remove direct bitcoin calls from qt/coincontroldialog.cpp 2018-04-04 16:52:40 -04:00
Russell Yanofsky
a0704a8996 Remove most direct bitcoin calls from qt/walletmodel.cpp 2018-04-04 16:52:40 -04:00
Russell Yanofsky
90d4640b7e Remove direct bitcoin calls from qt/optionsdialog.cpp 2018-04-04 16:52:40 -04:00
Russell Yanofsky
582daf6d22 Remove direct bitcoin calls from qt/rpcconsole.cpp 2018-04-04 16:52:40 -04:00
Russell Yanofsky
3034a462a5 Remove direct bitcoin calls from qt/bantablemodel.cpp 2018-04-04 16:52:40 -04:00
Russell Yanofsky
e0b66a3b7c Remove direct bitcoin calls from qt/peertablemodel.cpp 2018-04-04 16:52:40 -04:00
Russell Yanofsky
d7c2c95948 Remove direct bitcoin calls from qt/intro.cpp 2018-04-04 16:52:40 -04:00
Russell Yanofsky
fe6f27e6ea Remove direct bitcoin calls from qt/clientmodel.cpp 2018-04-04 16:52:40 -04:00
Russell Yanofsky
5fba3af21e Remove direct bitcoin calls from qt/splashscreen.cpp 2018-04-04 16:52:40 -04:00
Russell Yanofsky
c2f672fb19 Remove direct bitcoin calls from qt/utilitydialog.cpp 2018-04-04 16:52:40 -04:00