dash/src/script
PastaPastaPasta 141861ebae Merge #11117: Prepare for non-Base58 addresses (#3294)
* Merge #11117: Prepare for non-Base58 addresses

864cd2787 Move CBitcoinAddress to base58.cpp (Pieter Wuille)
5c8ff0d44 Introduce wrappers around CBitcoinAddress (Pieter Wuille)

Pull request description:

  This patch removes the need for the intermediary Base58 type `CBitcoinAddress`, by providing {`Encode`,`Decode`,`IsValid`}`Destination` functions that directly operate on the conversion between `std::string`s and `CTxDestination`.

  As a side, it also fixes a number of indentation issues, and removes probably several unnecessary implicit `CTxDestination`<->`CBitcoinAddress` conversions.

  This change is far from complete. In follow-ups I'd like to:
  * Split off the specific address and key encoding logic from base58.h, and move it to a address.h or so.
  * Replace `CTxDestination` with a non-`boost::variant` version (which can be more efficient as `boost::variant` allocates everything on the heap, and remove the need for `boost::get<...>` and `IsValidDestination` calls everywhere).
  * Do the same for `CBitcoinSecret`, `CBitcoinExtKey`, and `CBitcoinExtPubKey`.

  However, I've tried to keep this patch to be minimally invasive, but still enough to support non-Base58 addresses. Perhaps a smaller patch is possible to hack Bech32 support into `CBitcoinAddress`, but I would consider that a move in the wrong direction.

Tree-SHA512: c2c77ffb57caeadf2429b1c2562ce60e8c7be8aa9f8e51b591f354b6b441162625b2efe14c023a1ae485cf2ed417263afa35c892891dfaa7844e7fbabccab85e

* CBitcoinAddress -> EncodeDestination in providertx.h

Signed-off-by: Pasta <pasta@dashboost.org>

* more CBitcoinAddress -> EncodeDestination in providertx.h

Signed-off-by: Pasta <pasta@dashboost.org>

* more CBitcoinAddress -> EncodeDestination in providertx.h

Signed-off-by: Pasta <pasta@dashboost.org>

* more CBitcoinAddress -> EncodeDestination in providertx.h

Signed-off-by: Pasta <pasta@dashboost.org>

* fix CBitcoinAddress GetKeyID check

Signed-off-by: Pasta <pasta@dashboost.org>

* fix providertx.cpp

Signed-off-by: Pasta <pasta@dashboost.org>

* hopefully fix governance-classes.cpp

Signed-off-by: Pasta <pasta@dashboost.org>

* partially fix governance-validators.cpp, unable to resolve "address.IsScript()"

Signed-off-by: Pasta <pasta@dashboost.org>

* partially fix governance-classes.cpp, unable to resolve "address.IsScript()"

Signed-off-by: Pasta <pasta@dashboost.org>

* fix governance-classes.h

Signed-off-by: Pasta <pasta@dashboost.org>

* DecodeTransaction -> DecodeDestination, fix governance-validators.cpp

Signed-off-by: Pasta <pasta@dashboost.org>

* More fixes for 3294

* Move GetIndexKey into rpc/misc.cpp near getAddressesFromParams

No need to have it in base58.cpp anymore as this is only used in getAddressesFromParams

Co-authored-by: Wladimir J. van der Laan <laanwj@gmail.com>
Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
Co-authored-by: Alexander Block <ablock84@gmail.com>
2020-01-22 13:35:04 +03:00
..
dashconsensus.cpp Refactor script validation to observe amounts 2019-09-19 21:04:36 +02:00
dashconsensus.h Refactor script validation to observe amounts 2019-09-19 21:04:36 +02:00
interpreter.cpp Merge #11411: script: Change SignatureHash input index check to an assert. 2020-01-11 18:47:35 -06:00
interpreter.h Merge #10969: Declare single-argument (non-converting) constructors "explicit" 2020-01-10 10:33:57 -06:00
ismine.cpp Remove segwit related code 2019-09-20 11:10:06 +02:00
ismine.h Merge #7905: test: move accounting_tests and rpc_wallet_tests to wallet/test 2017-12-20 17:25:03 +01:00
script_error.cpp Merge #11418: Add error string for CLEANSTACK script violation 2020-01-11 18:47:35 -06:00
script_error.h Merge #8634: Add policy: null signature for failed CHECK(MULTI)SIG 2018-01-12 08:02:45 +01:00
script.cpp Merge #8808: Do not shadow variables (gcc set) 2019-02-01 00:41:12 -06:00
script.h Speed up prevector initialization and vector assignment from prevectors (#3274) 2020-01-08 08:02:17 +01:00
sigcache.cpp Merge #10192: Cache full script execution results in addition to signatures 2019-09-08 11:04:44 -05:00
sigcache.h Refactor script validation to observe amounts 2019-09-19 21:04:36 +02:00
sign.cpp Remove segwit related code 2019-09-20 11:10:06 +02:00
sign.h Merge #10969: Declare single-argument (non-converting) constructors "explicit" 2020-01-10 10:33:57 -06:00
standard.cpp Merge #11117: Prepare for non-Base58 addresses (#3294) 2020-01-22 13:35:04 +03:00
standard.h Merge #11117: Prepare for non-Base58 addresses (#3294) 2020-01-22 13:35:04 +03:00