From 825a0da92d2ac81aa512d3d28a1ba82526f45283 Mon Sep 17 00:00:00 2001 From: Steven Roose Date: Thu, 30 May 2019 16:51:25 +0100 Subject: [PATCH] Alias "blech32" to "bech32" for address creation This is technically not 100% correct since if blinded addresses are turned off, it will create a normal address for "blech32". But it's the simplest thing to do. --- src/outputtype.cpp | 3 ++- test/functional/feature_confidential_transactions.py | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/outputtype.cpp b/src/outputtype.cpp index cfd054e2f8..df4e3d9466 100644 --- a/src/outputtype.cpp +++ b/src/outputtype.cpp @@ -16,6 +16,7 @@ static const std::string OUTPUT_TYPE_STRING_LEGACY = "legacy"; static const std::string OUTPUT_TYPE_STRING_P2SH_SEGWIT = "p2sh-segwit"; static const std::string OUTPUT_TYPE_STRING_BECH32 = "bech32"; +static const std::string OUTPUT_TYPE_STRING_BLECH32 = "blech32"; bool ParseOutputType(const std::string& type, OutputType& output_type) { @@ -25,7 +26,7 @@ bool ParseOutputType(const std::string& type, OutputType& output_type) } else if (type == OUTPUT_TYPE_STRING_P2SH_SEGWIT) { output_type = OutputType::P2SH_SEGWIT; return true; - } else if (type == OUTPUT_TYPE_STRING_BECH32) { + } else if (type == OUTPUT_TYPE_STRING_BECH32 || type == OUTPUT_TYPE_STRING_BLECH32) { output_type = OutputType::BECH32; return true; } diff --git a/test/functional/feature_confidential_transactions.py b/test/functional/feature_confidential_transactions.py index 1d0dcdbb0b..39c90e03a0 100755 --- a/test/functional/feature_confidential_transactions.py +++ b/test/functional/feature_confidential_transactions.py @@ -104,6 +104,12 @@ def run_test(self): print("Testing wallet secret recovery") self.test_wallet_recovery() + # Test that "blech32" gives a blinded segwit address. + blech32_addr = self.nodes[0].getnewaddress("", "blech32") + blech32_addr_info = self.nodes[0].getaddressinfo(blech32_addr) + assert_equal(blech32_addr_info["iswitness"], True) + assert_equal(blech32_addr_info["confidential"], blech32_addr) + print("General Confidential tests") # Running balances node0 = self.nodes[0].getbalance()["bitcoin"]