Samuel Dobson
9dd7bd47be
Merge #18034 : Get the OutputType for a descriptor
...
7e80f646b24a2abf3c031a649bcc706a695f80da Get the OutputType for a descriptor (Andrew Chow)
Pull request description:
Adds a `GetOutputType()` method to get the OutputType of a descriptor. Some descriptors don't have a determinate OutputType, so we actually use an `Optional<OutputType>`. For descriptors with indeterminate OutputType, we return `nullopt`.
`addr()` and `raw()` use OutputTypes as determined by the CTxDestination they have. For simplicity, `ScriptHash` destinations are `LEGACY` even though they could be `P2SH_SEGWIT`.
`combo()`, `pk()`, and `multi()` are `nullopt` as they either don't have an OutputType or they have multiple. `DescriptorImpl` defaults to `nullopt`.
`pkh()` is `LEGACY` as expected
`wpkh()` and `wsh()` are `BECH32` as expected.
`sh()` checks whether the sub-descriptor is `BECH32`. If so, it is `P2SH_SEGWIT`. Otherwise it is `LEGACY`.
The descriptor tests are updated to check the OutputType too.
ACKs for top commit:
fjahr:
ACK 7e80f646b24a2abf3c031a649bcc706a695f80da
meshcollider:
utACK 7e80f646b24a2abf3c031a649bcc706a695f80da
instagibbs:
cursory ACK 7e80f646b2
Sjors:
Code review ACK 7e80f646b24a2abf3c031a649bcc706a695f80da
jonatack:
ACK 7e80f64 code review/build/tests
Tree-SHA512: c5a813447b62e982435e1c948066f8d6c148c9ebffb0a5eb5a9028b173b01d5ead2f076a5ca3f7f37698538baa346f82a977ee48f583d89cb4e5ebd9111b2341
2020-02-22 08:02:52 +13:00
..
2020-01-30 17:21:21 +13:00
2019-12-30 10:42:20 +13:00
2019-12-30 10:42:20 +13:00
2020-01-28 17:00:01 +01:00
2020-01-16 15:58:35 -05:00
2019-12-30 10:42:20 +13:00
2020-01-23 16:35:08 -05:00
2020-01-28 16:59:07 +01:00
2019-12-30 10:42:20 +13:00
2020-02-17 17:01:50 -08:00
2020-01-15 02:18:00 +07:00
2019-12-30 10:42:20 +13:00
2020-02-13 08:48:07 +01:00
2020-02-20 20:28:46 +08:00
2020-02-22 08:02:52 +13:00
2019-12-30 10:42:20 +13:00
2020-02-22 08:02:52 +13:00
2020-02-09 07:44:29 -08:00
2020-02-17 11:59:23 +01:00
2020-02-20 20:28:46 +08:00
2020-02-09 05:12:43 -08:00
2019-10-14 13:24:54 +03:00
2019-12-30 10:42:20 +13:00
2020-01-02 11:05:36 -08:00
2020-01-29 13:55:43 +01:00
2020-01-29 13:55:43 +01:00
2019-12-30 10:42:20 +13:00
2019-12-30 10:42:20 +13:00
2019-12-30 10:42:20 +13:00
2020-01-15 02:18:00 +07:00
2019-12-30 10:42:20 +13:00
2019-12-30 10:42:20 +13:00
2019-10-16 08:56:57 -07:00
2019-12-30 10:42:20 +13:00
2019-12-30 10:42:20 +13:00
2020-01-14 18:19:00 +00:00
2019-10-30 12:35:41 +01:00
2019-12-30 10:42:20 +13:00
2019-12-30 10:42:20 +13:00
2019-12-30 10:42:20 +13:00
2019-12-30 10:42:20 +13:00
2019-12-30 10:42:20 +13:00
2019-12-30 10:42:20 +13:00
2019-12-30 10:42:20 +13:00
2020-02-10 12:00:10 -08:00
2020-02-13 08:59:51 -08:00
2020-02-13 08:59:51 -08:00
2019-12-30 10:42:20 +13:00
2019-12-30 10:42:20 +13:00
2019-10-02 08:51:12 +02:00
2020-01-21 14:07:42 +00:00
2019-12-30 10:42:20 +13:00
2020-01-21 20:29:11 -08:00
2019-12-30 10:42:20 +13:00
2020-01-21 20:29:11 -08:00
2019-12-30 10:42:20 +13:00
2019-12-30 10:42:20 +13:00
2019-12-30 10:42:20 +13:00
2019-11-29 21:23:25 +02:00
2019-12-30 10:42:20 +13:00
2019-12-30 10:42:20 +13:00
2020-01-15 02:18:00 +07:00
2020-02-10 12:00:10 -08:00
2020-01-04 20:18:28 +02:00
2019-12-30 10:42:20 +13:00
2019-12-30 10:42:20 +13:00
2019-12-30 10:42:20 +13:00
2020-01-08 12:35:59 +00:00
2019-12-30 10:42:20 +13:00
2020-02-17 17:01:50 -08:00
2019-12-30 10:42:20 +13:00
2019-12-30 10:42:20 +13:00
2019-12-30 10:42:20 +13:00
2019-12-30 10:42:20 +13:00
2020-01-15 02:18:00 +07:00
2020-01-15 02:18:00 +07:00
2020-02-10 11:36:09 +01:00
2019-11-25 16:40:09 +01:00
2020-01-28 17:01:48 +01:00
2020-01-28 17:01:48 +01:00
2020-01-06 22:58:47 -05:00
2019-11-21 19:38:39 +01:00
2019-11-21 21:13:08 +01:00
2019-11-25 16:40:09 +01:00
2020-02-12 11:48:30 -05:00
2019-12-30 10:42:20 +13:00
2019-12-23 06:12:10 +07:00
2019-12-23 06:12:10 +07:00
2020-01-08 12:35:59 +00:00
2019-12-30 10:42:20 +13:00
2020-02-02 10:27:47 +01:00
2020-01-29 09:37:21 -05:00
2019-10-29 11:30:12 +02:00
2020-01-31 14:51:37 -08:00
2020-01-31 14:51:37 -08:00
2020-01-31 14:51:37 -08:00
2020-02-05 13:59:42 +01:00
2020-01-22 20:20:45 +01:00
2020-01-08 12:35:59 +00:00
2019-12-30 10:42:20 +13:00
2019-12-30 10:42:20 +13:00
2019-12-30 10:42:20 +13:00
2020-02-12 11:48:30 -05:00
2020-01-23 16:35:06 -05:00
2020-02-12 17:48:30 +01:00
2019-10-02 10:39:14 -04:00
2019-12-11 17:00:27 -05:00
2020-01-29 19:39:50 +08:00
2020-01-16 18:25:11 -08:00
2019-12-30 10:42:20 +13:00
2019-12-30 10:42:20 +13:00
2019-12-30 10:42:20 +13:00
2019-12-30 10:42:20 +13:00
2019-11-20 10:54:08 -08:00
2019-11-12 14:50:44 -08:00
2019-12-30 10:42:20 +13:00
2020-02-13 08:59:51 -08:00
2020-02-13 08:59:51 -08:00
2020-02-10 12:00:10 -08:00
2019-12-30 10:42:20 +13:00
2020-01-15 02:18:00 +07:00
2020-01-15 02:18:00 +07:00
2019-12-30 10:42:20 +13:00
2019-12-30 10:42:20 +13:00
2020-01-15 02:18:00 +07:00
2019-12-06 10:02:08 +01:00
2020-01-08 12:35:59 +00:00
2019-12-30 10:42:20 +13:00
2020-02-10 12:00:10 -08:00
2020-01-15 02:18:00 +07:00
2020-01-14 19:30:13 -08:00
2020-02-03 11:54:34 +01:00
2020-01-15 02:18:00 +07:00
2020-01-15 02:18:00 +07:00
2020-01-23 16:35:08 -05:00
2020-01-23 16:35:08 -05:00
2020-02-06 19:08:11 -08:00
2020-02-03 12:28:38 +01:00
2020-01-15 02:18:00 +07:00
2020-01-15 02:18:00 +07:00
2020-01-15 02:18:00 +07:00
2019-12-30 10:42:20 +13:00
2019-12-30 10:42:20 +13:00
2019-12-30 10:42:20 +13:00
2019-12-30 10:42:20 +13:00
2019-12-30 10:42:20 +13:00
2019-12-30 10:42:20 +13:00