lbrycrd/src/script
Wladimir J. van der Laan 735d6b57e7
Merge #16227: Refactor CWallet's inheritance chain
93ce4a0b6f Move WatchOnly stuff from SigningProvider to CWallet (Andrew Chow)
8f5b81e6ed Remove CCryptoKeyStore and move all of it's functionality into CWallet (Andrew Chow)
37a79a4fcc Move various SigningProviders to signingprovider.{cpp,h} (Andrew Chow)
16f8096e91 Move KeyOriginInfo to its own header file (Andrew Chow)
d9becff4e1 scripted-diff: rename CBasicKeyStore to FillableSigningProvider (Andrew Chow)
a913e3f2fb Move HaveKey static function from keystore to rpcwallet where it is used (Andrew Chow)
c7797ec655 Remove CKeyStore and squash into CBasicKeyStore (Andrew Chow)
1b699a5083 Add HaveKey and HaveCScript to SigningProvider (Andrew Chow)

Pull request description:

  This PR compresses the `CWallet` chain of inheritance from 5 classes to 3 classes. `CBasicKeyStore` is renamed to `FillableSigningProvider` and some parts of it (the watchonly parts) are moved into `CWallet`. `CKeyStore` and `CCrypoKeyStore` are completely removed. `CKeyStore`'s `Have*` functions are moved into `SigningProvider` and the `Add*` moved into `FillableSigningProvider`, thus allowing it to go away entirely. `CCryptoKeyStore`'s functionality is moved into `CWallet`. The new inheritance chain is:

  ```
  SigningProvider -> FillableSigningProvider -> CWallet
  ```

  `SigningProvider` now is the class the provides keys and scripts and indicates whether keys and scripts are present. `FillableSigningProvider` allows keys and scripts to be added to the signing provider via `Add*` functions. `CWallet` handles all of the watchonly stuff (`AddWatchOnly`, `HaveWatchOnly`, `RemoveWatchOnly` which were previously in `CKeyStore`) and key encryption (previously in `CCryptoKeyStore`).

  Implements the 2nd [prerequisite](https://github.com/bitcoin-core/bitcoin-devwiki/wiki/Wallet-Class-Structure-Changes#cwallet-subclass-stack) from the wallet restructure.

ACKs for top commit:
  Sjors:
    re-ACK 93ce4a0; it keeps `EncryptSecret`, `DecryptSecret` and `DecryptKey` in `wallet/crypter.cpp`, but makes them not static. It improves alphabetical includes, reorders some function definitions, fixes commit message, brings back lost code comment.
  instagibbs:
    utACK 93ce4a0b6f

Tree-SHA512: 393dfd0623ad2dac38395eb89b862424318d6072f0b7083c92a0d207fd032c48b284f5f2cb13bc492f34557de350c5fee925da02e47daf011c5c6930a721b6d3
2019-07-11 22:42:39 +02:00
..
bitcoinconsensus.cpp Drop unused GetType() from CSizeComputer 2018-09-11 00:58:05 -04:00
bitcoinconsensus.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
descriptor.cpp Add private key derivation functions to descriptors 2019-06-06 22:03:55 +12:00
descriptor.h Move various SigningProviders to signingprovider.{cpp,h} 2019-07-09 16:20:18 -04:00
interpreter.cpp Delete error-prone CScript constructor 2019-06-13 09:27:14 -04:00
interpreter.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
keyorigin.h Move KeyOriginInfo to its own header file 2019-07-09 16:20:18 -04:00
script.cpp Make reasoning about dependencies easier by not including unused dependencies 2019-06-02 17:15:23 +02:00
script.h Delete error-prone CScript constructor 2019-06-13 09:27:14 -04:00
script_error.cpp Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
script_error.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
sigcache.cpp Make reasoning about dependencies easier by not including unused dependencies 2019-06-02 17:15:23 +02:00
sigcache.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
sign.cpp Move various SigningProviders to signingprovider.{cpp,h} 2019-07-09 16:20:18 -04:00
sign.h Move various SigningProviders to signingprovider.{cpp,h} 2019-07-09 16:20:18 -04:00
signingprovider.cpp Move WatchOnly stuff from SigningProvider to CWallet 2019-07-09 16:20:18 -04:00
signingprovider.h Move WatchOnly stuff from SigningProvider to CWallet 2019-07-09 16:20:18 -04:00
standard.cpp Move various SigningProviders to signingprovider.{cpp,h} 2019-07-09 16:20:18 -04:00
standard.h Replace CScriptID and CKeyID in CTxDestination with dedicated types 2019-04-29 10:15:23 -04:00