From cf07085e6892a72aefe3bdaa50b2d0f6fa7e3e9a Mon Sep 17 00:00:00 2001 From: cryptozoidberg Date: Wed, 20 Nov 2019 23:03:27 +0100 Subject: [PATCH] fixed two coretests --- src/currency_core/blockchain_storage.cpp | 2 +- tests/core_tests/multisig_wallet_tests.cpp | 2 +- tests/core_tests/tx_validation.cpp | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/currency_core/blockchain_storage.cpp b/src/currency_core/blockchain_storage.cpp index 11515ab3..fcab2571 100644 --- a/src/currency_core/blockchain_storage.cpp +++ b/src/currency_core/blockchain_storage.cpp @@ -4774,7 +4774,7 @@ wide_difficulty_type blockchain_storage::get_last_alt_x_block_cumulative_precise return 0; } //------------------------------------------------------------------ -bool get_tx_from_cache(const crypto::hash& tx_id, transactions_map& tx_cache, transaction& tx, size_t& blob_size, uint64_t fee) +bool get_tx_from_cache(const crypto::hash& tx_id, transactions_map& tx_cache, transaction& tx, size_t& blob_size, uint64_t& fee) { auto it = tx_cache.find(tx_id); if (it == tx_cache.end()) diff --git a/tests/core_tests/multisig_wallet_tests.cpp b/tests/core_tests/multisig_wallet_tests.cpp index e69cd871..0582d3ab 100644 --- a/tests/core_tests/multisig_wallet_tests.cpp +++ b/tests/core_tests/multisig_wallet_tests.cpp @@ -2361,7 +2361,7 @@ bool multisig_out_make_and_spent_in_altchain::generate(std::vector& events) events.push_back(tx_2); events.push_back(event_visitor_settings(event_visitor_settings::set_txs_kept_by_block, false)); - DO_CALLBACK_PARAMS(events, "check_tx_pool_count", static_cast(3)); + DO_CALLBACK_PARAMS(events, "check_tx_pool_count", static_cast(1)); // make a block with tx_0 and put tx_0 to the blockchain MAKE_NEXT_BLOCK_TX1(events, blk_1, blk_0r, m_miner_acc, tx_0); - DO_CALLBACK_PARAMS(events, "check_tx_pool_count", static_cast(2)); + DO_CALLBACK_PARAMS(events, "check_tx_pool_count", static_cast(1)); // tx_1 and tx_2 is still in the pool // it can never be added to any block as long as blk_1 is in the blockchain due to key image conflict @@ -1531,7 +1531,7 @@ bool tx_key_image_pool_conflict::generate(std::vector& events) MAKE_NEXT_BLOCK_TX1(events, blk_1a, blk_0r, m_miner_acc, tx_1); // however, it does not remove tx from the pool - DO_CALLBACK_PARAMS(events, "check_tx_pool_count", static_cast(2)); + DO_CALLBACK_PARAMS(events, "check_tx_pool_count", static_cast(1)); // // make sure stuck tx will be removed from the pool when it's too old @@ -1541,7 +1541,7 @@ bool tx_key_image_pool_conflict::generate(std::vector& events) // remove_stuck_txs should not remove anything, tx_1 and tx_2 should be in the pool DO_CALLBACK(events, "remove_stuck_txs"); - DO_CALLBACK_PARAMS(events, "check_tx_pool_count", static_cast(2)); + DO_CALLBACK_PARAMS(events, "check_tx_pool_count", static_cast(1)); // shift time by CURRENCY_MEMPOOL_TX_LIVETIME events.push_back(event_core_time(CURRENCY_MEMPOOL_TX_LIVETIME + 1, true)); @@ -1562,11 +1562,11 @@ bool tx_key_image_pool_conflict::generate(std::vector& events) events.push_back(tx_2); events.push_back(event_visitor_settings(event_visitor_settings::set_txs_kept_by_block, false)); - DO_CALLBACK_PARAMS(events, "check_tx_pool_count", static_cast(2)); + DO_CALLBACK_PARAMS(events, "check_tx_pool_count", static_cast(1)); // remove_stuck_txs should not remove anything, tx_1 and tx_2 should be in the pool DO_CALLBACK(events, "remove_stuck_txs"); - DO_CALLBACK_PARAMS(events, "check_tx_pool_count", static_cast(2)); + DO_CALLBACK_PARAMS(events, "check_tx_pool_count", static_cast(1)); // rewind 50 blocks so tx_0 spending its key image will be deep enough REWIND_BLOCKS_N_WITH_TIME(events, blk_3r, blk_3, m_miner_acc, 50);