diff options
author | Andrew Chow <achow101-github@achow101.com> | 2020-02-28 19:14:12 -0500 |
---|---|---|
committer | Andrew Chow <achow101-github@achow101.com> | 2020-04-23 13:25:50 -0400 |
commit | 3194a7f88ac1a32997b390b4f188c4b6a4af04a5 (patch) | |
tree | b8c163a9609353485383ab25606910b6971e2152 /src/wallet/test/wallet_tests.cpp | |
parent | 6b13cd3fa854dfaeb9e269bff3d67cacc0e5b5dc (diff) |
Introduce WalletDescriptor class
WalletDescriptor is a Descriptor with other wallet metadata
Diffstat (limited to 'src/wallet/test/wallet_tests.cpp')
-rw-r--r-- | src/wallet/test/wallet_tests.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/wallet/test/wallet_tests.cpp b/src/wallet/test/wallet_tests.cpp index 42ae738207..2bdeb89f3c 100644 --- a/src/wallet/test/wallet_tests.cpp +++ b/src/wallet/test/wallet_tests.cpp @@ -637,4 +637,25 @@ BOOST_FIXTURE_TEST_CASE(dummy_input_size_test, TestChain100Setup) BOOST_CHECK_EQUAL(CalculateNestedKeyhashInputSize(true), DUMMY_NESTED_P2WPKH_INPUT_SIZE); } +bool malformed_descriptor(std::ios_base::failure e) +{ + std::string s(e.what()); + return s.find("Missing checksum") != std::string::npos; +} + +BOOST_FIXTURE_TEST_CASE(wallet_descriptor_test, BasicTestingSetup) +{ + std::vector<unsigned char> malformed_record; + CVectorWriter vw(0, 0, malformed_record, 0); + vw << std::string("notadescriptor"); + vw << (uint64_t)0; + vw << (int32_t)0; + vw << (int32_t)0; + vw << (int32_t)1; + + VectorReader vr(0, 0, malformed_record, 0); + WalletDescriptor w_desc; + BOOST_CHECK_EXCEPTION(vr >> w_desc, std::ios_base::failure, malformed_descriptor); +} + BOOST_AUTO_TEST_SUITE_END() |