mirror of
https://github.com/dashpay/dash.git
synced 2024-12-26 20:42:59 +01:00
Add required locks in tests
Unit tests with DEBUG_LOCKORDER were running into assertions.
This commit is contained in:
parent
bbe53f61db
commit
ed67100565
@ -65,7 +65,7 @@ BOOST_AUTO_TEST_CASE(rpc_wallet)
|
|||||||
// Test RPC calls for various wallet statistics
|
// Test RPC calls for various wallet statistics
|
||||||
Value r;
|
Value r;
|
||||||
|
|
||||||
LOCK(pwalletMain->cs_wallet);
|
LOCK2(cs_main, pwalletMain->cs_wallet);
|
||||||
|
|
||||||
BOOST_CHECK_NO_THROW(CallRPC("listunspent"));
|
BOOST_CHECK_NO_THROW(CallRPC("listunspent"));
|
||||||
BOOST_CHECK_THROW(CallRPC("listunspent string"), runtime_error);
|
BOOST_CHECK_THROW(CallRPC("listunspent string"), runtime_error);
|
||||||
|
@ -50,6 +50,7 @@ BOOST_AUTO_TEST_SUITE(script_P2SH_tests)
|
|||||||
|
|
||||||
BOOST_AUTO_TEST_CASE(sign)
|
BOOST_AUTO_TEST_CASE(sign)
|
||||||
{
|
{
|
||||||
|
LOCK(cs_main);
|
||||||
// Pay-to-script-hash looks like this:
|
// Pay-to-script-hash looks like this:
|
||||||
// scriptSig: <sig> <sig...> <serialized_script>
|
// scriptSig: <sig> <sig...> <serialized_script>
|
||||||
// scriptPubKey: HASH160 <hash> EQUAL
|
// scriptPubKey: HASH160 <hash> EQUAL
|
||||||
@ -147,6 +148,7 @@ BOOST_AUTO_TEST_CASE(norecurse)
|
|||||||
|
|
||||||
BOOST_AUTO_TEST_CASE(set)
|
BOOST_AUTO_TEST_CASE(set)
|
||||||
{
|
{
|
||||||
|
LOCK(cs_main);
|
||||||
// Test the CScript::Set* methods
|
// Test the CScript::Set* methods
|
||||||
CBasicKeyStore keystore;
|
CBasicKeyStore keystore;
|
||||||
CKey key[4];
|
CKey key[4];
|
||||||
@ -250,6 +252,7 @@ BOOST_AUTO_TEST_CASE(switchover)
|
|||||||
|
|
||||||
BOOST_AUTO_TEST_CASE(AreInputsStandard)
|
BOOST_AUTO_TEST_CASE(AreInputsStandard)
|
||||||
{
|
{
|
||||||
|
LOCK(cs_main);
|
||||||
CCoinsView coinsDummy;
|
CCoinsView coinsDummy;
|
||||||
CCoinsViewCache coins(coinsDummy);
|
CCoinsViewCache coins(coinsDummy);
|
||||||
CBasicKeyStore keystore;
|
CBasicKeyStore keystore;
|
||||||
|
@ -254,6 +254,7 @@ BOOST_AUTO_TEST_CASE(test_Get)
|
|||||||
|
|
||||||
BOOST_AUTO_TEST_CASE(test_IsStandard)
|
BOOST_AUTO_TEST_CASE(test_IsStandard)
|
||||||
{
|
{
|
||||||
|
LOCK(cs_main);
|
||||||
CBasicKeyStore keystore;
|
CBasicKeyStore keystore;
|
||||||
CCoinsView coinsDummy;
|
CCoinsView coinsDummy;
|
||||||
CCoinsViewCache coins(coinsDummy);
|
CCoinsViewCache coins(coinsDummy);
|
||||||
|
Loading…
Reference in New Issue
Block a user