diff options
author | MarcoFalke <falke.marco@gmail.com> | 2021-12-20 13:32:54 +0100 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2021-12-20 13:32:57 +0100 |
commit | 9ac064d245f0fd4cb0362cfc472b65836328bffe (patch) | |
tree | 2ab0907be3205a48af2d9f9014ecf96ebbe13556 /src/netbase.h | |
parent | 20aea4945d8011d1b7d9fd69ca4e56eecd5a6529 (diff) | |
parent | 140a49ce5e547a1b520a7cd063af8308184e7cbf (diff) |
Merge bitcoin/bitcoin#23796: test: check that pruneblockchain RPC fails for future block or timestamp
140a49ce5e547a1b520a7cd063af8308184e7cbf test: check that pruneblockchain RPC fails for future block or timestamp (Sebastian Falbesoner)
Pull request description:
This PR adds missing test coverage for the `pruneblockchain` RPC for the case that a future block or timestamp is passed:
https://github.com/bitcoin/bitcoin/blob/8c0bd871fcf6c5ff5851ccb18a7bc7554a0484b0/src/rpc/blockchain.cpp#L1101
https://github.com/bitcoin/bitcoin/blob/8c0bd871fcf6c5ff5851ccb18a7bc7554a0484b0/src/rpc/blockchain.cpp#L1111
Note that the test method `manual_test` gets called twice, once each with `use_timestamp` set to True/False, respectively. Depending on that, the helper function `height` either converts the passed block height to the timestamp of that block, or just returns it without modification.
The other tests for failures in this RPC are also changed to be more detailled ("Cannot prune blocks because node is not in prune mode", "Negative block height"), as I don't think there is any value in just checking a sub-string. If there is ever an error with the same sub-string is introduced, it's not clear which error is exactly checked with the test, so it makes sense to be as specific as possible.
ACKs for top commit:
brunoerg:
tACK 140a49ce5e547a1b520a7cd063af8308184e7cbf
Tree-SHA512: bee3cee9f35c2a63a1839d7ec1f83e354d9d3c0c2ca32d300dca2de8b755d555f769ba2b80ac37d31df6ee7e2b8eaefb8134c4727a7144e47c0f5e34f2cc5822
Diffstat (limited to 'src/netbase.h')
0 files changed, 0 insertions, 0 deletions