Eliminate recursive opening of transactions in unit tests.

Recursive transactions are unnecessary and will deadlock when memory protection is needed/added to ledger transactions.
This commit is contained in:
Colin LeMahieu 2024-04-13 11:45:24 +01:00
commit 7cd86ccf62
No known key found for this signature in database
GPG key ID: 43708520C8DFB938
2 changed files with 3 additions and 4 deletions

View file

@ -650,8 +650,7 @@ TEST (wallet, work_generate)
}
nano::keypair key;
auto block (wallet->send_action (nano::dev::genesis_key.pub, key.pub, 100));
auto transaction (node1.store.tx_begin_read ());
ASSERT_TIMELY (10s, node1.ledger.account_balance (transaction, nano::dev::genesis_key.pub) != amount1);
ASSERT_TIMELY (10s, node1.ledger.account_balance (node1.ledger.store.tx_begin_read (), nano::dev::genesis_key.pub) != amount1);
system.deadline_set (10s);
auto again (true);
while (again)

View file

@ -5770,8 +5770,8 @@ TEST (rpc, block_confirmed)
// Open an account directly in the ledger
{
auto transaction = node->store.tx_begin_write ();
nano::block_hash latest (node->latest (nano::dev::genesis_key.pub));
auto transaction = node->ledger.store.tx_begin_write ();
nano::block_hash latest (node->ledger.latest (transaction, nano::dev::genesis_key.pub));
auto send1 = builder
.send ()
.previous (latest)