aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/core_proxy/core_proxy.cpp3
-rw-r--r--tests/core_proxy/core_proxy.h2
-rw-r--r--tests/core_tests/rct.cpp6
-rw-r--r--tests/libwallet_api_tests/main.cpp2
-rw-r--r--tests/unit_tests/ban.cpp2
5 files changed, 8 insertions, 7 deletions
diff --git a/tests/core_proxy/core_proxy.cpp b/tests/core_proxy/core_proxy.cpp
index 366937e1d..aea810a11 100644
--- a/tests/core_proxy/core_proxy.cpp
+++ b/tests/core_proxy/core_proxy.cpp
@@ -229,10 +229,9 @@ bool tests::proxy_core::get_short_chain_history(std::list<crypto::hash>& ids) {
return true;
}
-bool tests::proxy_core::get_blockchain_top(uint64_t& height, crypto::hash& top_id) {
+void tests::proxy_core::get_blockchain_top(uint64_t& height, crypto::hash& top_id) {
height = 0;
top_id = get_block_hash(m_genesis);
- return true;
}
bool tests::proxy_core::init(const boost::program_options::variables_map& /*vm*/) {
diff --git a/tests/core_proxy/core_proxy.h b/tests/core_proxy/core_proxy.h
index 85518612a..09ed35b1b 100644
--- a/tests/core_proxy/core_proxy.h
+++ b/tests/core_proxy/core_proxy.h
@@ -74,7 +74,7 @@ namespace tests
bool get_short_chain_history(std::list<crypto::hash>& ids);
bool get_stat_info(cryptonote::core_stat_info& st_inf){return true;}
bool have_block(const crypto::hash& id);
- bool get_blockchain_top(uint64_t& height, crypto::hash& top_id);
+ void get_blockchain_top(uint64_t& height, crypto::hash& top_id);
bool handle_incoming_tx(const cryptonote::blobdata& tx_blob, cryptonote::tx_verification_context& tvc, bool keeped_by_block, bool relayed, bool do_not_relay);
bool handle_incoming_txs(const std::list<cryptonote::blobdata>& tx_blobs, std::vector<cryptonote::tx_verification_context>& tvc, bool keeped_by_block, bool relayed, bool do_not_relay);
bool handle_incoming_block(const cryptonote::blobdata& block_blob, cryptonote::block_verification_context& bvc, bool update_miner_blocktemplate = true);
diff --git a/tests/core_tests/rct.cpp b/tests/core_tests/rct.cpp
index 21638354d..1bdd48fa1 100644
--- a/tests/core_tests/rct.cpp
+++ b/tests/core_tests/rct.cpp
@@ -484,8 +484,9 @@ bool gen_rct_tx_pre_rct_altered_extra::generate(std::vector<test_event_entry>& e
const int mixin = 2;
const int out_idx[] = {0, -1};
const uint64_t amount_paid = 10000;
+ bool failed = false;
return generate_with(events, out_idx, mixin, amount_paid, false,
- NULL, [](transaction &tx) {std::string extra_nonce; crypto::hash pid = cryptonote::null_hash; set_payment_id_to_tx_extra_nonce(extra_nonce, pid); add_extra_nonce_to_tx_extra(tx.extra, extra_nonce);});
+ NULL, [&failed](transaction &tx) {std::string extra_nonce; crypto::hash pid = cryptonote::null_hash; set_payment_id_to_tx_extra_nonce(extra_nonce, pid); if (!add_extra_nonce_to_tx_extra(tx.extra, extra_nonce)) failed = true; }) && !failed;
}
bool gen_rct_tx_rct_altered_extra::generate(std::vector<test_event_entry>& events) const
@@ -493,7 +494,8 @@ bool gen_rct_tx_rct_altered_extra::generate(std::vector<test_event_entry>& event
const int mixin = 2;
const int out_idx[] = {1, -1};
const uint64_t amount_paid = 10000;
+ bool failed = false;
return generate_with(events, out_idx, mixin, amount_paid, false,
- NULL, [](transaction &tx) {std::string extra_nonce; crypto::hash pid = cryptonote::null_hash; set_payment_id_to_tx_extra_nonce(extra_nonce, pid); add_extra_nonce_to_tx_extra(tx.extra, extra_nonce);});
+ NULL, [&failed](transaction &tx) {std::string extra_nonce; crypto::hash pid = cryptonote::null_hash; set_payment_id_to_tx_extra_nonce(extra_nonce, pid); if (!add_extra_nonce_to_tx_extra(tx.extra, extra_nonce)) failed = true; }) && !failed;
}
diff --git a/tests/libwallet_api_tests/main.cpp b/tests/libwallet_api_tests/main.cpp
index bf0483b0f..d08ab7c75 100644
--- a/tests/libwallet_api_tests/main.cpp
+++ b/tests/libwallet_api_tests/main.cpp
@@ -811,7 +811,7 @@ struct MyWalletListener : public Monero::WalletListener
void reset()
{
- send_triggered = receive_triggered = update_triggered = refresh_triggered = false;
+ send_triggered = receive_triggered = newblock_triggered = update_triggered = refresh_triggered = false;
}
virtual void moneySpent(const string &txId, uint64_t amount)
diff --git a/tests/unit_tests/ban.cpp b/tests/unit_tests/ban.cpp
index 82ff058b1..7d4daafb3 100644
--- a/tests/unit_tests/ban.cpp
+++ b/tests/unit_tests/ban.cpp
@@ -51,7 +51,7 @@ public:
bool get_short_chain_history(std::list<crypto::hash>& ids) const { return true; }
bool get_stat_info(cryptonote::core_stat_info& st_inf) const {return true;}
bool have_block(const crypto::hash& id) const {return true;}
- bool get_blockchain_top(uint64_t& height, crypto::hash& top_id)const{height=0;top_id=cryptonote::null_hash;return true;}
+ void get_blockchain_top(uint64_t& height, crypto::hash& top_id)const{height=0;top_id=cryptonote::null_hash;}
bool handle_incoming_tx(const cryptonote::blobdata& tx_blob, cryptonote::tx_verification_context& tvc, bool keeped_by_block, bool relayed, bool do_not_relay) { return true; }
bool handle_incoming_txs(const std::list<cryptonote::blobdata>& tx_blob, std::vector<cryptonote::tx_verification_context>& tvc, bool keeped_by_block, bool relayed, bool do_not_relay) { return true; }
bool handle_incoming_block(const cryptonote::blobdata& block_blob, cryptonote::block_verification_context& bvc, bool update_miner_blocktemplate = true) { return true; }