diff options
author | Pieter Wuille <pieter@wuille.net> | 2021-01-05 12:55:15 -0800 |
---|---|---|
committer | Pieter Wuille <pieter@wuille.net> | 2021-03-15 17:26:35 -0700 |
commit | da2bb6976dadeec682d163c258c9afecc87d6428 (patch) | |
tree | 4bc543987df4b721cde20aa102ffe50dbe639a29 /src/test/bech32_tests.cpp | |
parent | 4ba1bab44390090a939d5ab2dee1440330f9a2d7 (diff) | |
download | bitcoin-da2bb6976dadeec682d163c258c9afecc87d6428.tar.xz |
Implement Bech32m encoding/decoding
Diffstat (limited to 'src/test/bech32_tests.cpp')
-rw-r--r-- | src/test/bech32_tests.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/test/bech32_tests.cpp b/src/test/bech32_tests.cpp index a2098f4f56..2ddc284761 100644 --- a/src/test/bech32_tests.cpp +++ b/src/test/bech32_tests.cpp @@ -22,9 +22,9 @@ BOOST_AUTO_TEST_CASE(bip173_testvectors_valid) "?1ezyfcl", }; for (const std::string& str : CASES) { - auto ret = bech32::Decode(str); - BOOST_CHECK(!ret.first.empty()); - std::string recode = bech32::Encode(ret.first, ret.second); + const auto dec = bech32::Decode(str); + BOOST_CHECK(dec.encoding == bech32::Encoding::BECH32); + std::string recode = bech32::Encode(bech32::Encoding::BECH32, dec.hrp, dec.data); BOOST_CHECK(!recode.empty()); BOOST_CHECK(CaseInsensitiveEqual(str, recode)); } @@ -49,8 +49,8 @@ BOOST_AUTO_TEST_CASE(bip173_testvectors_invalid) "A12uEL5L", }; for (const std::string& str : CASES) { - auto ret = bech32::Decode(str); - BOOST_CHECK(ret.first.empty()); + const auto dec = bech32::Decode(str); + BOOST_CHECK(dec.encoding != bech32::Encoding::BECH32); } } |