mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-10 14:08:40 +01:00
scripted-diff: Use new naming style for insecure_rand* functions
-BEGIN VERIFY SCRIPT- sed -i 's/\<insecure_randbits(/InsecureRandBits(/g' src/test/*.cpp src/test/*.h src/wallet/test/*.cpp sed -i 's/\<insecure_randbool(/InsecureRandBool(/g' src/test/*.cpp src/test/*.h src/wallet/test/*.cpp sed -i 's/\<insecure_randrange(/InsecureRandRange(/g' src/test/*.cpp src/test/*.h src/wallet/test/*.cpp sed -i 's/\<insecure_randbytes(/InsecureRandBytes(/g' src/test/*.cpp src/test/*.h src/wallet/test/*.cpp sed -i 's/\<insecure_rand256(/InsecureRand256(/g' src/test/*.cpp src/test/*.h src/wallet/test/*.cpp sed -i 's/\<insecure_rand(/InsecureRand32(/g' src/test/*.cpp src/test/*.h src/wallet/test/*.cpp sed -i 's/\<seed_insecure_rand(/SeedInsecureRand(/g' src/test/*.cpp src/test/*.h src/wallet/test/*.cpp -END VERIFY SCRIPT-
This commit is contained in:
@@ -31,7 +31,7 @@ BOOST_AUTO_TEST_CASE(dbwrapper)
|
||||
fs::path ph = fs::temp_directory_path() / fs::unique_path();
|
||||
CDBWrapper dbw(ph, (1 << 20), true, false, obfuscate);
|
||||
char key = 'k';
|
||||
uint256 in = insecure_rand256();
|
||||
uint256 in = InsecureRand256();
|
||||
uint256 res;
|
||||
|
||||
// Ensure that we're doing real obfuscation when obfuscate=true
|
||||
@@ -53,11 +53,11 @@ BOOST_AUTO_TEST_CASE(dbwrapper_batch)
|
||||
CDBWrapper dbw(ph, (1 << 20), true, false, obfuscate);
|
||||
|
||||
char key = 'i';
|
||||
uint256 in = insecure_rand256();
|
||||
uint256 in = InsecureRand256();
|
||||
char key2 = 'j';
|
||||
uint256 in2 = insecure_rand256();
|
||||
uint256 in2 = InsecureRand256();
|
||||
char key3 = 'k';
|
||||
uint256 in3 = insecure_rand256();
|
||||
uint256 in3 = InsecureRand256();
|
||||
|
||||
uint256 res;
|
||||
CDBBatch batch(dbw);
|
||||
@@ -91,10 +91,10 @@ BOOST_AUTO_TEST_CASE(dbwrapper_iterator)
|
||||
|
||||
// The two keys are intentionally chosen for ordering
|
||||
char key = 'j';
|
||||
uint256 in = insecure_rand256();
|
||||
uint256 in = InsecureRand256();
|
||||
BOOST_CHECK(dbw.Write(key, in));
|
||||
char key2 = 'k';
|
||||
uint256 in2 = insecure_rand256();
|
||||
uint256 in2 = InsecureRand256();
|
||||
BOOST_CHECK(dbw.Write(key2, in2));
|
||||
|
||||
std::unique_ptr<CDBIterator> it(const_cast<CDBWrapper*>(&dbw)->NewIterator());
|
||||
@@ -132,7 +132,7 @@ BOOST_AUTO_TEST_CASE(existing_data_no_obfuscate)
|
||||
// Set up a non-obfuscated wrapper to write some initial data.
|
||||
CDBWrapper* dbw = new CDBWrapper(ph, (1 << 10), false, false, false);
|
||||
char key = 'k';
|
||||
uint256 in = insecure_rand256();
|
||||
uint256 in = InsecureRand256();
|
||||
uint256 res;
|
||||
|
||||
BOOST_CHECK(dbw->Write(key, in));
|
||||
@@ -155,7 +155,7 @@ BOOST_AUTO_TEST_CASE(existing_data_no_obfuscate)
|
||||
BOOST_CHECK(!odbw.IsEmpty()); // There should be existing data
|
||||
BOOST_CHECK(is_null_key(dbwrapper_private::GetObfuscateKey(odbw))); // The key should be an empty string
|
||||
|
||||
uint256 in2 = insecure_rand256();
|
||||
uint256 in2 = InsecureRand256();
|
||||
uint256 res3;
|
||||
|
||||
// Check that we can write successfully
|
||||
@@ -174,7 +174,7 @@ BOOST_AUTO_TEST_CASE(existing_data_reindex)
|
||||
// Set up a non-obfuscated wrapper to write some initial data.
|
||||
CDBWrapper* dbw = new CDBWrapper(ph, (1 << 10), false, false, false);
|
||||
char key = 'k';
|
||||
uint256 in = insecure_rand256();
|
||||
uint256 in = InsecureRand256();
|
||||
uint256 res;
|
||||
|
||||
BOOST_CHECK(dbw->Write(key, in));
|
||||
@@ -193,7 +193,7 @@ BOOST_AUTO_TEST_CASE(existing_data_reindex)
|
||||
BOOST_CHECK(!odbw.Read(key, res2));
|
||||
BOOST_CHECK(!is_null_key(dbwrapper_private::GetObfuscateKey(odbw)));
|
||||
|
||||
uint256 in2 = insecure_rand256();
|
||||
uint256 in2 = InsecureRand256();
|
||||
uint256 res3;
|
||||
|
||||
// Check that we can write successfully
|
||||
|
||||
Reference in New Issue
Block a user