forked from bitcoin/bitcoin
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5681 from vijaydasmp/bp22_17
backport: Merge bitcoin#20466,14604,15710,17458,18722,(partial) 17934
- Loading branch information
Showing
13 changed files
with
156 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Copyright (c) 2012-2019 The Bitcoin Core developers | ||
// Distributed under the MIT software license, see the accompanying | ||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||
|
||
#include <test/util/setup_common.h> | ||
#include <clientversion.h> | ||
#include <streams.h> | ||
#include <uint256.h> | ||
|
||
#include <boost/test/unit_test.hpp> | ||
|
||
BOOST_FIXTURE_TEST_SUITE(walletdb_tests, BasicTestingSetup) | ||
|
||
BOOST_AUTO_TEST_CASE(walletdb_readkeyvalue) | ||
{ | ||
/** | ||
* When ReadKeyValue() reads from either a "key" or "wkey" it first reads the CDataStream steam into a | ||
* CPrivKey or CWalletKey respectively and then reads a hash of the pubkey and privkey into a uint256. | ||
* Wallets from 0.8 or before do not store the pubkey/privkey hash, trying to read the hash from old | ||
* wallets throws an exception, for backwards compatibility this read is wrapped in a try block to | ||
* silently fail. The test here makes sure the type of exception thrown from CDataStream::read() | ||
* matches the type we expect, otherwise we need to update the "key"/"wkey" exception type caught. | ||
*/ | ||
CDataStream ssValue(SER_DISK, CLIENT_VERSION); | ||
uint256 dummy; | ||
BOOST_CHECK_THROW(ssValue >> dummy, std::ios_base::failure); | ||
} | ||
|
||
BOOST_AUTO_TEST_SUITE_END() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.