diff options
author | Pieter Wuille <pieter@wuille.net> | 2021-01-05 12:55:15 -0800 |
---|---|---|
committer | Pieter Wuille <pieter@wuille.net> | 2021-03-27 12:09:13 -0700 |
commit | 1485533092a0732bae55313659a3e3f9669fd77a (patch) | |
tree | d67e5f8780cb44088706e0231629bcb85492a1b2 /src/test/bech32_tests.cpp | |
parent | a30fd40735eb5646dd4bf3c78d1532fde14502b6 (diff) | |
download | bitcoin-1485533092a0732bae55313659a3e3f9669fd77a.tar.xz |
Implement Bech32m encoding/decoding
Github-Pull: #20861
Rebased-From: da2bb6976dadeec682d163c258c9afecc87d6428
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); } } |