aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/core_proxy/core_proxy.h1
-rw-r--r--tests/unit_tests/ban.cpp1
-rw-r--r--tests/unit_tests/output_selection.cpp8
3 files changed, 6 insertions, 4 deletions
diff --git a/tests/core_proxy/core_proxy.h b/tests/core_proxy/core_proxy.h
index 0f6d6571e..995b0c650 100644
--- a/tests/core_proxy/core_proxy.h
+++ b/tests/core_proxy/core_proxy.h
@@ -87,5 +87,6 @@ namespace tests
bool prepare_handle_incoming_blocks(const std::list<cryptonote::block_complete_entry> &blocks) { return true; }
bool cleanup_handle_incoming_blocks(bool force_sync = false) { return true; }
uint64_t get_target_blockchain_height() const { return 1; }
+ size_t get_block_sync_size() const { return BLOCKS_SYNCHRONIZING_DEFAULT_COUNT; }
};
}
diff --git a/tests/unit_tests/ban.cpp b/tests/unit_tests/ban.cpp
index a5ce244d9..85b0298b7 100644
--- a/tests/unit_tests/ban.cpp
+++ b/tests/unit_tests/ban.cpp
@@ -62,6 +62,7 @@ public:
bool prepare_handle_incoming_blocks(const std::list<cryptonote::block_complete_entry> &blocks) { return true; }
bool cleanup_handle_incoming_blocks(bool force_sync = false) { return true; }
uint64_t get_target_blockchain_height() const { return 1; }
+ size_t get_block_sync_size() const { return BLOCKS_SYNCHRONIZING_DEFAULT_COUNT; }
};
typedef nodetool::node_server<cryptonote::t_cryptonote_protocol_handler<test_core>> Server;
diff --git a/tests/unit_tests/output_selection.cpp b/tests/unit_tests/output_selection.cpp
index 4344d1ffc..d26f5ae1a 100644
--- a/tests/unit_tests/output_selection.cpp
+++ b/tests/unit_tests/output_selection.cpp
@@ -56,14 +56,14 @@ static tools::wallet2::transfer_container make_transfers_container(size_t N)
auto i = std::find(unused_indices.begin(), unused_indices.end(), idx); \
ASSERT_TRUE(i != unused_indices.end()); \
unused_indices.erase(i); \
- selected.push_back(transfers.begin() + idx); \
+ selected.push_back(idx); \
} while(0)
#define PICK(expected) \
do { \
size_t idx = w.pop_best_value_from(transfers, unused_indices, selected); \
ASSERT_EQ(expected, idx); \
- selected.push_back(transfers.begin() + idx); \
+ selected.push_back(idx); \
} while(0)
TEST(select_outputs, one_out_of_N)
@@ -76,7 +76,7 @@ TEST(select_outputs, one_out_of_N)
tools::wallet2::transfer_container transfers = make_transfers_container(10);
transfers[6].m_block_height = 700;
std::vector<size_t> unused_indices({0, 1, 2, 3, 4, 5, 6, 7, 8, 9});
- std::list<tools::wallet2::transfer_container::iterator> selected;
+ std::list<size_t> selected;
SELECT(2);
PICK(6);
}
@@ -93,7 +93,7 @@ TEST(select_outputs, order)
transfers[3].m_block_height = 716;
transfers[4].m_block_height = 701;
std::vector<size_t> unused_indices({0, 1, 2, 3, 4});
- std::list<tools::wallet2::transfer_container::iterator> selected;
+ std::list<size_t> selected;
SELECT(0);
PICK(3); // first the one that's far away
PICK(2); // then the one that's close