Commit Graph

791 Commits

Author SHA1 Message Date
MarcoFalke cac6d1184d
Merge #13048: [tests] Fix feature_block flakiness
c1d742025c [tests] Fix feature_block flakiness (John Newbery)

Pull request description:

  feature_block.py occasionally fails on Travis. I believe this is due to
  a a race condition when reconnecting to bitcoind after a subtest that
  expects disconnection. If the test runs ahead and sends the INV for the
  subsequent test before we've received the initial sync getheaders, then
  we may end up sending two headers messages - one as a response to the
  initial sync getheaders and one in response to the INV getheaders. If
  both of those headers fail validation with a DoS score of 50 or higher,
  then we'll unexpectedly be disconnected.

  There is only one validation failure that has a DoS score bewteen 50 and
  100, which is high-hash. That's why the test is failing immediately
  after the "Reject a block with invalid work" subtest.

  Fix is to wait for the initial getheaders from the peer before we
  start populating our blockstore. That way we won't have any invalid
  headers to respond to it with.

Tree-SHA512: dc17d795fcfaf0f8c0bf1e9732b5e11fbc8febbfafba4c231b7c13a5404a2c297dcd703a7a75bc7f353c893e12efc87f424f2201abd47ba5268af32d4d2e841f
2018-04-21 21:00:06 -04:00
John Newbery c1d742025c [tests] Fix feature_block flakiness
feature_block.py occasionally fails on Travis. I believe this is due to
a a race condition when reconnecting to bitcoind after a subtest that
expects disconnection. If the test runs ahead and sends the INV for the
subsequent test before we've received the initial sync getheaders, then
we may end up sending two headers messages - one as a response to the
initial sync getheaders and one in response to the INV getheaders. If
both of those headers fail validation with a DoS score of 50 or higher,
then we'll unexpectedly be disconnected.

There is only one validation failure that has a DoS score bewteen 50 and
100, which is high-hash. That's why the test is failing immediately
after the "Reject a block with invalid work" subtest.

Fix is to wait for the initial getheaders from the peer before we
start populating our blockstore. That way we won't have any invalid
headers to respond to it with.
2018-04-20 15:45:31 -04:00
John Newbery 4d355bfb2b [tests] tidy up blocktools.py
Moves function comments to docstrings, and moves the module-level
constant to the top of the file.
2018-04-20 14:16:57 -04:00
John Newbery cab8be5adf [tests] Fix flake8 warnings in blocktools.py 2018-04-20 14:10:12 -04:00
Jesse Cohen b184127db2 [doc][trivial] no retargeting in regtest mode 2018-04-20 13:55:22 -04:00
MarcoFalke 0a8b7b4b33
Merge #11739: Enforce SCRIPT_VERIFY_P2SH and SCRIPT_VERIFY_WITNESS from genesis
8b56fc0b91 [qa] Test that v0 segwit outputs can't be spent pre-activation (Suhas Daftuar)
ccb8ca42a4 Always enforce SCRIPT_VERIFY_WITNESS with P2SH (Suhas Daftuar)
5c31b20a35 [qa] Remove some pre-activation segwit tests (Suhas Daftuar)
95749a5836 Separate NULLDUMMY enforcement from SEGWIT enforcement (Suhas Daftuar)
ce650182f4 Use P2SH consensus rules for all blocks (Suhas Daftuar)

Pull request description:

  As discussed at the IRC meeting back in October (https://botbot.me/freenode/bitcoin-core-dev/2017-10-12/?msg=92231929&page=2), I had looked into the feasibility of enforcing P2SH and SCRIPT_VERIFY_WITNESS back to the genesis block.

  The P2SH change is pretty straightforward -- there was only one historical block on mainnet that violated the rule, so I carved out an exception to it, similar to the way we have exceptions for the BIP30 violators.

  The segwit change is not entirely as clear.  The code changes themselves are relatively straightforward: we can just always turn on SCRIPT_VERIFY_WITNESS whenever P2SH is active.  However conceptually, this amounts to splitting up BIP141 into two parts, the part that implements new script rules, and the part that handles witness commitments in blocks.

  Arguably though the script rules are really defined in BIP 143 anyway, and so this really amounts to backdating BIP 143 -- script rules for v0 segwit outputs -- back to genesis.  So maybe conceptually this isn't so bad...

  I don't feel strongly about this change in either direction; I started working on it because I was searching for a way to simplify the way we understand and implement the consensus rules around segwit, but I'm not yet sure whether I think this achieves anything toward that goal.

  ping @TheBlueMatt

Tree-SHA512: 73551d4a983eb9792c7ac67f56005822528ac4d1fd52c27cee6d305ebee953f69687ef4ddee8bdc0fec77f77e6b5a9d669750793efee54c076533a095e233042
2018-04-19 14:38:40 -04:00
Jonas Schnelli 3a8a4dc4a1
Merge #12791: Expose a transaction's weight via RPC
9e50c337c Note new weight field in release-notes. (Matt Corallo)
d0d9112b7 Test new weight field in p2p_segwit (Matt Corallo)
2874709a9 Expose a transaction's weight via RPC (Matt Corallo)

Pull request description:

  This seems like an obvious oversight.

Tree-SHA512: defd047de34fb06a31f589e1a4eef68fcae85095cc67b7c8fb434237bb40300d7f3f97e852d3e7226330e26b96943846b7baf6da0cfc79db8d56e9c1f7848ad9
2018-04-17 20:05:23 +02:00
Evan Klitzke 6a3b0d3d1a Print to console by default when not run with -daemon
Printing to the debug log file can be disabled with -nodebulogfile
2018-04-17 09:58:05 +02:00
Wladimir J. van der Laan 4366f61cc9
Merge #11862: Network specific conf sections
c25321f Add config changes to release notes (Anthony Towns)
5e3cbe0 [tests] Unit tests for -testnet/-regtest in [test]/[regtest] sections (Anthony Towns)
005ad26 ArgsManager: special handling for -regtest and -testnet (Anthony Towns)
608415d [tests] Unit tests for network-specific config entries (Anthony Towns)
68797e2 ArgsManager: Warn when ignoring network-specific config setting (Anthony Towns)
d1fc4d9 ArgsManager: limit some options to only apply on mainnet when in default section (Anthony Towns)
8a9817d [tests] Use regtest section in functional tests configs (Anthony Towns)
30f9407 [tests] Unit tests for config file sections (Anthony Towns)
95eb66d ArgsManager: support config file sections (Anthony Towns)
4d34fcc ArgsManager: drop m_negated_args (Anthony Towns)
3673ca3 ArgsManager: keep command line and config file arguments separate (Anthony Towns)

Pull request description:

  The weekly meeting on [2017-12-07](http://www.erisian.com.au/meetbot/bitcoin-core-dev/2017/bitcoin-core-dev.2017-12-07-19.00.log.html) discussed allowing options to bitcoin to have some sensitivity to what network is in use. @theuni suggested having sections in the config file:

      <cfields> an alternative to that would be sections in a config file. and on the
                cmdline they'd look like namespaces. so, [testnet] port=5. or -testnet::port=5.

  This approach is (more or less) supported by `boost::program_options::detail::config_file_iterator` -- when it sees a `[testnet]` section with `port=5`, it will treat that the same as "testnet.port=5". So `[testnet] port=5` (or `testnet.port=5` without the section header) in bitcoin.conf and `-testnet.port=5` on the command line.

  The other aspect to this question is possibly limiting some options so that there is no possibility of accidental cross-contamination across networks. For example, if you're using a particular wallet.dat on mainnet, you may not want to accidentally use the same wallet on testnet and risk reusing keys.

  I've set this up so that the `-addnode` and `-wallet` options are `NETWORK_ONLY`, so that if you have a bitcoin.conf:

      wallet=/secret/wallet.dat
      upnp=1

  and you run `bitcoind -testnet` or `bitcoind -regtest`, then the `wallet=` setting will be ignored, and should behave as if your bitcoin.conf had specified:

      upnp=1

      [main]
      wallet=/secret/wallet.dat

  For any `NETWORK_ONLY` options, if you're using `-testnet` or `-regtest`, you'll have to add the prefix to any command line options. This was necessary for `multiwallet.py` for instance.

  I've left the "default" options as taking precedence over network specific ones, which might be backwards. So if you have:

      maxmempool=200
      [regtest]
      maxmempool=100

  your maxmempool will still be 200 on regtest. The advantage of doing it this way is that if you have `[regtest] maxmempool=100` in bitcoin.conf, and then say `bitcoind -regtest -maxmempool=200`, the same result is probably in line with what you expect...

  The other thing to note is that I'm using the chain names from `chainparamsbase.cpp` / `ChainNameFromCommandLine`, so the sections are `[main]`, `[test]` and `[regtest]`; not `[mainnet]` or `[testnet]` as might be expected.

  Thoughts? Ping @MeshCollider @laanwj @jonasschnelli @morcos

Tree-SHA512: f00b5eb75f006189987e5c15e154a42b66ee251777768c1e185d764279070fcb7c41947d8794092b912a03d985843c82e5189871416995436a6260520fb7a4db
2018-04-16 20:52:38 +02:00
MarcoFalke 6a278e0640
Merge #12996: tests: Remove redundant bytes(…) calls
9db48c5634 tests: Remove redundant bytes² (practicalswift)

Pull request description:

  This is a follow-up to #12993. As @jnewbery noted `bytes()` is idempotent.

Tree-SHA512: 0eb25e0c2c46f9abaac30f964c5eb422bece1414c840a717d86794424294cb19d995a6db7c8df2a2f4ec84776b05274a637f2c111738f397051f510e57184752
2018-04-16 11:53:57 -04:00
practicalswift 9db48c5634 tests: Remove redundant bytes² 2018-04-16 17:33:03 +02:00
practicalswift f020aca297 Minor Python cleanups to make flake8 pass with the new rules enabled 2018-04-16 17:25:11 +02:00
practicalswift b95f9a61e0 tests: Remove compatibility code not needed now when we're on Python 3 2018-04-16 09:54:27 +02:00
Matt Corallo d0d9112b79 Test new weight field in p2p_segwit 2018-04-13 15:18:26 -04:00
Matt Corallo 2874709a9f Expose a transaction's weight via RPC 2018-04-13 15:18:26 -04:00
Suhas Daftuar 8b56fc0b91 [qa] Test that v0 segwit outputs can't be spent pre-activation
Also updates the comments for an existing test, that now should be rewritten.
Includes changes suggested by John Newbery.
2018-04-13 10:35:27 -04:00
Suhas Daftuar 5c31b20a35 [qa] Remove some pre-activation segwit tests
This is in preparation for always enforcing SCRIPT_VERIFY_WITNESS.
2018-04-13 10:35:27 -04:00
Gregory Sanders 6cba60ace2 speed up wallet_hd.py and clarify/augment checks 2018-04-11 11:49:37 -04:00
Anthony Towns 8a9817d175 [tests] Use regtest section in functional tests configs 2018-04-11 23:15:28 +10:00
Wladimir J. van der Laan 9b3370d1c6
Merge #12892: [wallet] [rpc] introduce 'label' API for wallet
41ba061 [docs] Add release notes for wallet 'label' API. (John Newbery)
189e0ef [wallet] [rpc] introduce 'label' API for wallet (Wladimir J. van der Laan)

Pull request description:

  Add label API to wallet RPC.

  This is one step towards #3816 ("Remove bolt-on account system") although it doesn't
  actually remove anything yet.

  These initially mirror the account functions, with the following differences:

  - These functions aren't DEPRECATED in the help
  - Help mentions 'label' instead of accounts. In the language used, labels are
    associated with addresses, instead of addresses associated with labels. (unlike
    with accounts.)
  - Labels have no balance
    - No balances in `listlabels`
    - `listlabels` has no minconf or watchonly argument
  - Like in the GUI, labels can be set on any address, not just receiving addreses
  - Unlike accounts, labels can be deleted.
    Being unable to delete them is a common annoyance (see #1231).
    Currently only by reassigning all addresses using `setlabel`, but an explicit
    call `deletelabel` which assigns all address to the default label may make
    sense.

Tree-SHA512: 45cc313c68ad529ce3a15c02181d2ab0083a7e14fe824e2cde34972713fecce512e3d4b9aa46db5355f2baa857c44b234d4fe9709225bc23c7ebbc0e03febbf5
2018-04-11 11:41:20 +02:00
Wladimir J. van der Laan 189e0ef33e [wallet] [rpc] introduce 'label' API for wallet
Add label API to wallet RPC.

This is one step towards #3816 ("Remove bolt-on account system") although it doesn't
actually remove anything yet.

These initially mirror the account functions, with the following differences:

- These functions aren't DEPRECATED in the help
- Help mentions 'label' instead of accounts. In the language used, labels are
  associated with addresses, instead of addresses associated with labels. (unlike
  with accounts.)
- Labels have no balance
  - No balances in `listlabels`
  - `listlabels` has no minconf or watchonly argument
- Like in the GUI, labels can be set on any address, not just receiving addreses
- Unlike accounts, labels can be deleted.
  Being unable to delete them is a common annoyance (see #1231).
  Currently only by reassigning all addresses using `setlabel`, but an explicit
  call `deletelabel` which assigns all address to the default label may make
  sense.

Thanks to Pierre Rochard for test fixes.
2018-04-10 19:27:22 -04:00
Wladimir J. van der Laan a84b056d5f
Merge #12749: [wallet] feebumper: discard change outputs below discard rate
f526046 adapt bumpfee change discard test to be more strict and add note on p2sh discrep (Gregory Sanders)
5805d6f feebumper: discard change outputs below discard rate (Gregory Sanders)

Pull request description:

  The "discard rate" is the concept we use to ensure the wallet isnt creating not so useful just-above-relay dust.

  Outside of bumpfee previous to this PR, and manually creating such an output, the wallet will never make change outputs of that size, preferring to send them to fees instead.

  "Worst case" for the user is that users pay a slightly higher feerate than they were expecting, which is already a possibility with relay dust.

Tree-SHA512: dd69351810dc1709437602e7db1be46e4e905ccd8e16d03952de8b4c1fdbf9cb7e6c99968930896baf6b5c7cb005a03ec0506a2669d22e21e32982e60329606b
2018-04-10 19:35:51 +02:00
MarcoFalke 727175a08d
Merge #12902: [qa] Handle potential cookie race when starting node
75d0e4c544 [qa] Delete cookie file before starting node (Suhas Daftuar)

Pull request description:

  When a node is restarted during a test after an unclean shutdown (such
  as with -dbcrashratio), it's possible an old cookie file was left
  behind. This can cause a race condition when restarting the node, where
  the test framework might try to connect using credentials from the
  old cookie file, just as the node will generate new credentials and
  overwrite the old file.

  Delete any such cookie file if present prior to startup.

Tree-SHA512: ae1e8bf8fd20e07c32b0715025693bb28b0e3dd34f328cae4346abf579b0c97b5db1c02782e1c46b7a3b6058d268b6d46b668e847658a6eed0be857ffb0d65dc
2018-04-09 19:11:08 -04:00
MarcoFalke cf8073f8d1
Merge #12917: qa: Windows fixups for functional tests
fab9095d40 qa: Windows fixups for functional tests (MarcoFalke)

Pull request description:

  Just two minor fixups to have less errors when the tests run on native windows.
  * Strip whitespace from lines when reading from a notification file
  * Instead of clumsily creating a file with weird permissions, just create a folder for the same effect in `mempool_persist.py`

Tree-SHA512: 48a8b439f14ab9b44c5cd228cd03105e8613e703e3c2951cdf724931bc95172a9ad9bfe69fc23e73dd91b058c1352263c0ac6e8de2ceb0ebf804c8ff52bba394
2018-04-09 14:37:05 -04:00
Suhas Daftuar 75d0e4c544 [qa] Delete cookie file before starting node
If a cookie file exists in a datadir prior to node startup, it must have
been leftover from a prior unclean shutdown. As bitcoind will overwrite
it anyway, delete it before starting up to prevent the test framework
from inadvertently trying to connect using stale credentials.
2018-04-09 14:35:09 -04:00
Wladimir J. van der Laan 0700b6f778
Merge #11851: scripted-diff: Rename wallet database classes
9b0f0c5 Add m_ prefix to WalletBatch::m_batch (Russell Yanofsky)
398c6f0 Update walletdb comment after renaming. (Russell Yanofsky)
ea23945 scripted-diff: Rename wallet database classes (Russell Yanofsky)

Pull request description:

  Scripted diff to rename some wallet classes. Motivated by discussion in https://github.com/bitcoin/bitcoin/pull/11687#discussion_r155354119

  | Current          | New                 |
  | ---------------- | ------------------- |
  | CDBEnv           | BerkeleyEnvironment |
  | CDB              | BerkeleyBatch       |
  | CWalletDBWrapper | WalletDatabase      |
  | CWalletDB        | WalletBatch         |

  Berkeley\* classes are intended to contain BDB specific code, while Wallet\* classes are intended to be more backend-agnostic.

  Also renamed associated variables:

  | Current             | New             |
  | ------------------- | --------------- |
  | dbw                 | database        |
  | pwalletdb           | batch           |
  | pwalletdbEncryption | encrypted_batch |

Tree-SHA512: 372f2e24b2deb59d4792b5ed578aaf0cce51b6db41c400bef5d0c2cd7833e62ae4d4afa0f6000268d52e15b20f737c5a55f1cecf7768556a782fd8cd6fe051d9
2018-04-09 19:29:54 +02:00
Karl-Johan Alm bf08fc5b6b
test: Assert on correct variable 2018-04-09 08:51:02 +09:00
Wladimir J. van der Laan 27278dffe8
Merge #12856: Tests: Add Metaclass for BitcoinTestFramework
c9cce0a Tests: Add Metaclass for BitcoinTestFramework (Will Ayd)

Pull request description:

  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

Tree-SHA512: 5a47a7ead1f18361138cad4374747c4a8f29d25506f7b2c2a8c1c966a0b65e5ccf7317f9a078df8680fdab5d3fb71fee46a159c9f381878a3683c1e9f874abbe
2018-04-08 19:47:08 +02:00
MarcoFalke bd42b85e8b
Merge #12905: [rpcwallet] Clamp walletpassphrase value at 100M seconds
2b2b96cd45 Use std::bind instead of boost::bind to re-lock the wallet (Suhas Daftuar)
662d19ff72 [rpcwallet] Clamp walletpassphrase value at 100M seconds (Suhas Daftuar)

Pull request description:

  Larger values seem to trigger a bug on macos+libevent (resulting in the rpc server stopping).

Tree-SHA512: 890f3b641f6c586e2f8f629a9d23bca6ceb8b237b285561aad488cb7adf941a21177d3129d0c2b8293c0a673cd8e401957dbe2b6b3b7c8c4e991bb411d260102
2018-04-08 12:58:46 -04:00
MarcoFalke fab9095d40
qa: Windows fixups for functional tests 2018-04-08 12:44:43 -04:00
Wladimir J. van der Laan 15c3bb4268
Merge #12904: [qa] Ensure bitcoind processes are cleaned up when tests end
e36a0c0 [qa] Ensure bitcoind processes are cleaned up when tests end (Suhas Daftuar)

Pull request description:

  When tests fail (such as due to a bug in the test, race condition, etc), it's possible that we could follow code paths that bypass our normal node shutdown that occurs in `TestNode.stop_node`.  Add a destructor to `TestNode` that cleans this up.

Tree-SHA512: 72e04bc21462ebd0cb346fd1fe0540da454acfbad41923a0b06ea2317e9045b68e58f9adb02d8200891aca89a9d03a022eb72282aeb31a3b3afe7c6843a4b450
2018-04-08 17:40:28 +02:00
Suhas Daftuar e36a0c0852 [qa] Ensure bitcoind processes are cleaned up when tests end 2018-04-08 10:47:31 -04:00
Suhas Daftuar 662d19ff72 [rpcwallet] Clamp walletpassphrase value at 100M seconds
Larger values seem to trigger a bug on macos+libevent (resulting in the
rpc server stopping).
2018-04-08 10:44:40 -04:00
Russell Yanofsky ea23945dbc scripted-diff: Rename wallet database classes
-BEGIN VERIFY SCRIPT-

sed -i 's/\<CWalletDBWrapper\>/BerkeleyDatabase/g' src/wallet/db.h src/wallet/db.cpp
sed -i '/statuses/i/** Backend-agnostic database type. */\nusing WalletDatabase = BerkeleyDatabase\;\n' src/wallet/walletdb.h
ren() { git grep -l "\<$1\>" 'src/*.cpp' 'src/*.h' ':(exclude)*dbwrapper*' test | xargs sed -i "s:\<$1\>:$2:g"; }
ren CDBEnv           BerkeleyEnvironment
ren CDB              BerkeleyBatch
ren CWalletDBWrapper WalletDatabase
ren CWalletDB        WalletBatch
ren dbw              database
ren m_dbw            m_database
ren walletdb         batch
ren pwalletdb        batch
ren pwalletdbIn      batch_in
ren wallet/batch.h   wallet/walletdb.h
ren pwalletdbEncryption encrypted_batch

-END VERIFY SCRIPT-
2018-04-07 11:48:27 -05:00
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
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
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
Roman Zeyde 55efc1f62c
[tests] simplify binary and hex response parsing in interface_rest.py
We use assert_greater_than_or_equal(), since the hex response contains
an extra b'\n' traling byte.
2018-04-03 10:53:59 +03:00
John Newbery ade5964e3f
[tests] only use 2 nodes in interface_rest.py 2018-04-03 10:53:52 +03:00
John Newbery ad00fbed3c
[tests] refactor interface_rest.py to avoid code repetition
Also refactor txout index parsing and formatting.
2018-04-03 10:53:45 +03:00
John Newbery 7a3181a767
[tests] Make json request building more consistent in interface_rest.py 2018-04-03 10:53:37 +03:00
John Newbery 3fd4490db1
[tests] improve logging and documentation in interface_rest.py 2018-04-03 10:53:29 +03:00
John Newbery abf190e4e7
[tests] fix flake8 warnings in interface_rest.py test 2018-04-03 10:53:24 +03:00
ccdle12 8dd547d82b Adding logging for loop iteration level in p2p_sendheaders.py
Changing logs to debug level and format of statment to j == ...

Updating debug statements to include comments when checking for iteration level of i and j

Removing comments above log prints in Part 3

Removing unwanted file

Added log prints in loops in p2p_sendheaders
2018-04-02 23:49:59 +01:00
John Newbery 89fe5feea2 [tests] Stop feature_block.py from blowing up memory.
The new P2PDataStore class was sending full blocks in headers messages,
which meant that calls to send_blocks_and_test() would blow up memory if
called with a large number of blocks. Fix that by only sending headers
in headers messages.
2018-04-02 15:40:40 -04:00
John Newbery 9c92c8c827 [tests] Remove Comparison Test Framework 2018-04-02 14:04:07 -04:00
John Newbery e80c640d78 [tests] Remove 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.
2018-04-02 13:45:58 -04:00
Wladimir J. van der Laan 18815b4bfb
Merge #11742: rpc: Add testmempoolaccept
b55555d rpc: Add testmempoolaccept (MarcoFalke)

Pull request description:

  To check if a single raw transaction makes it into the current transaction pool, one had to call `sendrawtransaction`. However, on success, this adds the transaction to the mempool with no easy way to undo.

  The call `testmempoolaccept` is introduced to provide a way to solely check the result without changing the mempool state.

Tree-SHA512: 5afd9311190135cee8fc1f229c7d39bf893f1028f29e28d34f70df820198ff97b4bf86b41cbbd6e6c36a5c30073cefa92d541c74a4939c7a2a6fa283dfd41b63
2018-04-02 16:02:33 +02:00