Files
wownero/tests/fuzz/fuzz_rpc/initialisation.h
+3 a9145f9d38 FCMP++/Carrot mega commit [9/14/26]
Co-authored-by: jeffro256 <jeffro256@tutanota.com>
Co-authored-by: Luke Parker <lukeparker5132@gmail.com>
Co-authored-by: Lee *!* Clagett <code@leeclagett.com>
Co-authored-by: SyntheticBird45 <someoneelse.is_on.github.rio7x@simplelogin.com>
Co-authored-by: jeetrex17 <jeetrex@tutamail.com>
Co-authored-by: UkoeHB <ukoehb@users.noreply.github.com>
Co-authored-by: MrCyjaneK
Co-authored-by: tobtoht
Co-authored-by: selsta
Co-authored-by: Thomas <thomas.giudici@proton.me>
Co-authored-by: navidR
Co-authored-by: Boog900 <boog900@tutanota.com>
2026-09-17 18:33:24 -07:00

32 lines
1.3 KiB
C++

#pragma once
#include "crypto/hash.h"
#include "rpc/core_rpc_server.h"
#include <fuzzer/FuzzedDataProvider.h>
// Define templates for dummy protocol object
template class nodetool::node_server<cryptonote::t_cryptonote_protocol_handler<cryptonote::core>>;
struct DummyProtocol final : public cryptonote::i_cryptonote_protocol {
public:
bool is_synchronized() const;
bool relay_transactions(cryptonote::NOTIFY_NEW_TRANSACTIONS::request&, std::vector<crypto::hash>&&, const boost::uuids::uuid&, epee::net_utils::zone, cryptonote::relay_method) override;
bool relay_block(cryptonote::NOTIFY_NEW_FLUFFY_BLOCK::request&, cryptonote::cryptonote_connection_context&);
};
struct RpcServerBundle {
std::unique_ptr<cryptonote::t_cryptonote_protocol_handler<cryptonote::core>> proto_handler;
std::unique_ptr<nodetool::node_server<cryptonote::t_cryptonote_protocol_handler<cryptonote::core>>> dummy_p2p;
std::unique_ptr<cryptonote::core_rpc_server> rpc;
};
struct CoreEnv {
std::unique_ptr<DummyProtocol> protocol;
std::unique_ptr<cryptonote::core> core;
};
std::unique_ptr<CoreEnv> initialise_rpc_core();
std::unique_ptr<RpcServerBundle> initialise_rpc_server(cryptonote::core&, bool);
bool generate_random_blocks(cryptonote::core&, FuzzedDataProvider&);
extern std::vector<crypto::hash> cached_tx_hashes;