bitcoin/src/wallet/test
MarcoFalke baa9fc941c
Merge bitcoin/bitcoin#22787: refactor: actual immutable pointing
54011e7aa2 refactor: use CWallet const shared pointers when possible (Karl-Johan Alm)
96461989a2 refactor: const shared_ptrs (Karl-Johan Alm)

Pull request description:

  ```C++
  const std::shared_ptr<CWallet> wallet = x;
  ```
  means we can not do `wallet = y`, but we can totally do `wallet->DestructiveOperation()`, contrary to what that line looks like.

  This PR

  * introduces a new convention: always use const shared pointers to `CWallet`s (even when we mutate the pointed-to thing)
  * uses `const shared_ptr<const CWallet>` everywhere where wallets are not modified

  In the future, this should preferably apply to all shared pointers, not limited to just `CWallet`s.

  Both of these serve the same purpose: to dispell the misconception that `const shared_ptr<X>` immutates `X`. It doesn't, and it's dangerous to leave this misconception as is, for obvious reasons.

ACKs for top commit:
  theStack:
    re-ACK 54011e7aa2

Tree-SHA512: 3bf4062fc821751be30770c6b4ead10a016847970f155a0a5156f304347d221b9830840030c2fbfba8cd1e282f4eda45f5b4107fe6df8138afdcb6c2e95a2836
2021-10-29 10:52:37 +02:00
..
coinselector_tests.cpp tests: Place into mapWallet in coinselector_tests 2021-10-22 17:49:43 -04:00
db_tests.cpp refactor: Block unsafe fs::path std::string conversion calls 2021-10-05 11:10:47 -04:00
init_test_fixture.cpp refactor: Block unsafe fs::path std::string conversion calls 2021-10-05 11:10:47 -04:00
init_test_fixture.h scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
init_tests.cpp refactor: Block unsafe fs::path std::string conversion calls 2021-10-05 11:10:47 -04:00
ismine_tests.cpp scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
psbt_wallet_tests.cpp tests: Use descriptors in psbt_wallet_tests 2021-10-15 17:01:51 -04:00
scriptpubkeyman_tests.cpp test: Remove no longer needed MakeChain calls 2020-12-07 20:46:03 -05:00
spend_tests.cpp tests: Use legacy change type in subtract fee from outputs test 2021-10-15 17:01:51 -04:00
util.cpp tests: Use Descriptor wallets for generic wallet tests 2021-10-15 17:01:51 -04:00
util.h wallet test refactor: add CreateSyncedWallet function 2021-06-12 11:22:41 -04:00
wallet_crypto_tests.cpp scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
wallet_test_fixture.cpp refactor: move first run detection to client code 2021-05-19 08:50:16 +02:00
wallet_test_fixture.h test: Remove no longer needed MakeChain calls 2020-12-07 20:46:03 -05:00
wallet_tests.cpp refactor: const shared_ptrs 2021-10-25 16:12:19 +09:00
walletdb_tests.cpp scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00