31 #include "gtest/gtest.h" 34 #include "p2p/net_node.inl" 36 #include "cryptonote_protocol/cryptonote_protocol_handler.inl" 38 #define MAKE_IPV4_ADDRESS(a,b,c,d) epee::net_utils::ipv4_network_address{MAKE_IP(a,b,c,d),0} 41 class blockchain_storage;
51 bool init(
const boost::program_options::variables_map& vm) {
return true ;}
58 bool handle_incoming_txs(
const std::vector<cryptonote::blobdata>& tx_blob, std::vector<cryptonote::tx_verification_context>& tvc,
bool keeped_by_block,
bool relayed,
bool do_not_relay) {
return true; }
65 cryptonote::blockchain_storage &
get_blockchain_storage() {
throw std::runtime_error(
"Called invalid member function: please never call get_blockchain_storage on the TESTING class test_core."); }
76 bool get_blocks(
uint64_t start_offset,
size_t count, std::vector<std::pair<cryptonote::blobdata, cryptonote::block>>&
blocks, std::vector<cryptonote::blobdata>& txs)
const {
return false; }
77 bool get_transactions(
const std::vector<crypto::hash>& txs_ids, std::vector<cryptonote::transaction>& txs, std::vector<crypto::hash>& missed_txs)
const {
return false; }
102 for (
auto rec: hosts)
104 if (rec.first == host)
216 namespace cryptonote {
template class t_cryptonote_protocol_handler<test_core>; }
void set_block_cumulative_difficulty(uint64_t height, cryptonote::difficulty_type diff)
uint8_t get_ideal_hard_fork_version(uint64_t height) const
void set_target_blockchain_height(uint64_t)
bool get_stat_info(cryptonote::core_stat_info &st_inf) const
std::string get_validators_list()
#define MAKE_IPV4_ADDRESS(a, b, c, d)
bool prune_blockchain(uint32_t pruning_seed=0)
bool get_short_chain_history(std::list< crypto::hash > &ids) const
bool get_block_by_hash(const crypto::hash &h, cryptonote::block &blk, bool *orphan=NULL) const
uint64_t get_earliest_ideal_height_for_version(uint8_t version) const
void set_p2p_endpoint(nodetool::i_p2p_endpoint< connection_context > *p2p)
bool prepare_handle_incoming_blocks(const std::vector< cryptonote::block_complete_entry > &blocks_entry, std::vector< cryptonote::block > &blocks)
bool handle_incoming_txs(const std::vector< cryptonote::blobdata > &tx_blob, std::vector< cryptonote::tx_verification_context > &tvc, bool keeped_by_block, bool relayed, bool do_not_relay)
virtual void on_transaction_relayed(const cryptonote::blobdata &tx)
cryptonote::blockchain_storage & get_blockchain_storage()
cryptonote::difficulty_type get_block_cumulative_difficulty(uint64_t height) const
bool init(const boost::program_options::variables_map &vm)
#define BLOCKS_SYNCHRONIZING_DEFAULT_COUNT
struct hash_func hashes[]
#define ASSERT_FALSE(condition)
bool cleanup_handle_incoming_blocks(bool force_sync=false)
Holds cryptonote related classes and helpers.
mdb_size_t count(MDB_cursor *cur)
bool get_test_drop_download() const
bool isValidatorsListValid()
uint8_t get_hard_fork_version(uint64_t height) const
unsigned __int64 uint64_t
std::unique_ptr< void, terminate > context
Unique ZMQ context handle, calls zmq_term on destruction.
version
Supported socks variants.
size_t get_block_sync_size(uint64_t height) const
This is the orginal cryptonote protocol network-events handler, modified by us.
uint64_t get_current_blockchain_height() const
uint32_t get_blockchain_pruning_seed() const
bool find_blockchain_supplement(const std::list< crypto::hash > &qblock_ids, cryptonote::NOTIFY_RESPONSE_CHAIN_ENTRY::request &resp)
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 get_blocks(uint64_t start_offset, size_t count, std::vector< std::pair< cryptonote::blobdata, cryptonote::block >> &blocks, std::vector< cryptonote::blobdata > &txs) const
bool get_transactions(const std::vector< crypto::hash > &txs_ids, std::vector< cryptonote::transaction > &txs, std::vector< crypto::hash > &missed_txs) const
cryptonote::network_type get_nettype() const
boost::multiprecision::uint128_t difficulty_type
nodetool::node_server< cryptonote::t_cryptonote_protocol_handler< test_core > > Server
#define ASSERT_TRUE(condition)
uint64_t prevalidate_block_hashes(uint64_t height, const std::vector< crypto::hash > &hashes)
bool get_test_drop_download_height() const
bool have_block(const crypto::hash &id) const
bool fluffy_blocks_enabled() const
uint64_t get_target_blockchain_height() const
void safesyncmode(const bool)
void get_blockchain_top(uint64_t &height, crypto::hash &top_id) const
bool handle_get_objects(cryptonote::NOTIFY_REQUEST_GET_OBJECTS::request &arg, cryptonote::NOTIFY_RESPONSE_GET_OBJECTS::request &rsp, cryptonote::cryptonote_connection_context &context)
bool handle_incoming_block(const cryptonote::blobdata &block_blob, const cryptonote::block *block, cryptonote::block_verification_context &bvc, bool update_miner_blocktemplate=true)
uint8_t get_ideal_hard_fork_version() const
electroneum::basic::list_update_outcome set_validators_list(std::string v_list, bool isEmergencyUpdate=false)
bool get_pool_transaction(const crypto::hash &id, cryptonote::blobdata &tx_blob) const
bool pool_has_tx(const crypto::hash &txid) const