Skip to content

Commit d8247a4

Browse files
committed
Merge bitcoin#640: Alias "blech32" to "bech32" for address creation
825a0da Alias "blech32" to "bech32" for address creation (Steven Roose) Pull request description: Closes bitcoin#631 Tree-SHA512: 7a372cb0c84466dea9654d743b478b64548d8178ef0d60e5b085efacdf592d46cc3b22abef102c430226dc2e96a86fe8c0ba2a014480ab3962c951b1cc95316c
2 parents 4858d36 + 825a0da commit d8247a4

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/outputtype.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
static const std::string OUTPUT_TYPE_STRING_LEGACY = "legacy";
1717
static const std::string OUTPUT_TYPE_STRING_P2SH_SEGWIT = "p2sh-segwit";
1818
static const std::string OUTPUT_TYPE_STRING_BECH32 = "bech32";
19+
static const std::string OUTPUT_TYPE_STRING_BLECH32 = "blech32";
1920

2021
bool ParseOutputType(const std::string& type, OutputType& output_type)
2122
{
@@ -25,7 +26,7 @@ bool ParseOutputType(const std::string& type, OutputType& output_type)
2526
} else if (type == OUTPUT_TYPE_STRING_P2SH_SEGWIT) {
2627
output_type = OutputType::P2SH_SEGWIT;
2728
return true;
28-
} else if (type == OUTPUT_TYPE_STRING_BECH32) {
29+
} else if (type == OUTPUT_TYPE_STRING_BECH32 || type == OUTPUT_TYPE_STRING_BLECH32) {
2930
output_type = OutputType::BECH32;
3031
return true;
3132
}

test/functional/feature_confidential_transactions.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,12 @@ def run_test(self):
104104
print("Testing wallet secret recovery")
105105
self.test_wallet_recovery()
106106

107+
# Test that "blech32" gives a blinded segwit address.
108+
blech32_addr = self.nodes[0].getnewaddress("", "blech32")
109+
blech32_addr_info = self.nodes[0].getaddressinfo(blech32_addr)
110+
assert_equal(blech32_addr_info["iswitness"], True)
111+
assert_equal(blech32_addr_info["confidential"], blech32_addr)
112+
107113
print("General Confidential tests")
108114
# Running balances
109115
node0 = self.nodes[0].getbalance()["bitcoin"]

0 commit comments

Comments
 (0)