15 #include <boost/test/unit_test.hpp>
31 CSeederNodeTest(
const CService &service, std::vector<CAddress> *vAddrIn)
34 void TestProcessMessage(
const std::string &strCommand,
CDataStream &message,
53 testNode = std::make_unique<CSeederNodeTest>(service, &
vAddr);
68 uint64_t addr_to_services = vAddr[0].nServices;
71 std::string user_agent =
"/Bitcoin ABC:0.0.0(seeder)/";
75 << addr_to_services << addr_to << serviceflags << addr_from
103 sendBuffer >> header;
109 sendBuffer >> locator >> hashStop;
110 std::vector<BlockHash> expectedLocator = {
120 payload << sendAddrs;
126 std::vector<CAddress> sendAddrs(
ADDR_SOFT_CAP - 1, vAddr[0]);
146 size_t expectedSize = vAddr.size() + 1;
147 for (
size_t i = 1; i < 10; i++) {
148 sendAddrs.resize(i, sendAddrs[0]);
void SelectParams(const std::string &network)
Sets the params returned by Params() to those for the given BIP70 chain name.
const CChainParams & Params()
Return the currently selected parameters.
static const std::string REGTEST
const CCheckpointData & Checkpoints() const
const CMessageHeader::MessageMagic & NetMagic() const
Double ended buffer combining vector and stream-like interfaces.
bool SetInternal(const std::string &name)
Create an "internal" address that represents a name or FQDN.
PeerMessagingState ProcessMessage(std::string strCommand, CDataStream &recv)
A combination of a network address (CNetAddr) and a (TCP) port.
static node::NodeContext testNode
const char * GETADDR
The getaddr message requests an addr message from the receiving node, preferably one with lots of IP ...
const char * ADDR
The addr (IP address) message relays connection information for peers on the network.
const char * VERSION
The version message provides information about the transmitting node to the receiving node at the beg...
const char * GETHEADERS
The getheaders message requests a headers message that provides block headers starting from a particu...
const char * VERACK
The verack message acknowledges a previously-received version message, informing the connecting node ...
#define BOOST_AUTO_TEST_SUITE_END()
#define BOOST_CHECK_EQUAL(v1, v2)
#define BOOST_CHECK(expr)
static const uint16_t SERVICE_PORT
static CDataStream CreateAddrMessage(std::vector< CAddress > sendAddrs, uint32_t nVersion=INIT_PROTO_VERSION)
std::ostream & operator<<(std::ostream &os, const PeerMessagingState &state)
BOOST_AUTO_TEST_CASE(process_version_msg)
static const int SEEDER_INIT_VERSION
ServiceFlags
nServices flags.
static const unsigned int ADDR_SOFT_CAP
static int GetRequireHeight()
constexpr std::underlying_type< E >::type to_integral(E e)
BOOST_FIXTURE_TEST_SUITE(stakingrewards_tests, StakingRewardsActivationTestingSetup) BOOST_AUTO_TEST_CASE(isstakingrewardsactivated)
Describes a place in the block chain to another node such that if the other node doesn't have the sam...
std::vector< BlockHash > vHave
MapCheckpoints mapCheckpoints
std::vector< CAddress > vAddr
std::unique_ptr< CSeederNodeTest > testNode
static const int INIT_PROTO_VERSION
initial proto version, to be increased after version/verack negotiation