This commit addresses #20809.
We add an additional 'error' property in the result of 'validateaddress' in case the address is not valid that gives a short description of why the address in invalid. We also change the error message returned by 'getaddressinfo' in case the address is invalid.
https://github.com/bitcoin/bitcoin/pull/20832 (1/1)
ELEMENTS: Merge conflicts resolved based on d6c85c5620 (from 22.0 rebase)
This PR adds a fuzz test ensuring that all the different destination types
round-trip to strings (an important test given that Satoshi managed to mess
this up, having two different address types encode the same way..)
Anyway we fail this test, since both CNoDestination and NullData encode as
empty strings, and then this "decodes" as CNoDestination (and returns an
error, but the fuzztest doesn't check that). To make the fuzzer pass, I
changed NullData to encode and decode as "null".
I think this actually adds some functionality, letting you use "null" as
an "address" for sendtoaddress and createrawtransaction, thus burning the
coins and fixing #1011...but this was not my intent and we probably want
to think a bit more carefully before deliberately supporting this.
Does the bare minimum to introduce Taproot wallet support with CT; just
adds a CPubKey blinding_pubkey to the taproot destination variant and
updates some visitors.
In future when we define blech32 we will need to make sure we are using
that encoding and using the pubkey.
This commit addresses #20809.
We add an additional 'error' property in the result of 'validateaddress' in case the address is not valid that gives a short description of why the address in invalid. We also change the error message returned by 'getaddressinfo' in case the address is invalid.
Also re-`static`'d a method in src/script/standard.cpp which we had made globally
visible for some historical reason, but which I noticed diffing that file against
upstream.
1ac3c983bf Mark single-argument constructors "explicit" (practicalswift)
Pull request description:
Mark single-argument constructors `explicit`.
Rationale:
* Avoid unexpected implicit promotions.
From the developer notes:
> **By default, declare single-argument constructors explicit.**
> Rationale: This is a precaution to avoid unintended conversions that might arise when single-argument constructors are used as implicit conversion functions.
Tree-SHA512: 7901ed5be808c9d0ecb5ca501e1bc0395987fe1b7941b8548cebac2ff08a14f7dab61fab374a69b9ba29a9295a04245c814325c7f95b97ae558af0780f111dfa