Changeset View
Changeset View
Standalone View
Standalone View
src/seeder/test/db_tests.cpp
| Show All 35 Lines | static SeederAddrInfo BuildSeederAddrInfo(const CService &ip, bool good, | ||||
| CAddrStat stat1W; | CAddrStat stat1W; | ||||
| CAddrStat stat1M; | CAddrStat stat1M; | ||||
| int total{0}; | int total{0}; | ||||
| int success{0}; | int success{0}; | ||||
| std::string clientSubVersion{}; | std::string clientSubVersion{}; | ||||
| int blocks{0}; | int blocks{0}; | ||||
| int64_t ourLastSuccess{0}; | int64_t ourLastSuccess{0}; | ||||
| info_stream << version << ip << services << lastTry << tried << ourLastTry | info_stream << version << WithParams(CAddress::V1_DISK, ip) << services | ||||
| << ignoreTill << stat2H << stat8H << stat1D << stat1W << stat1M | << lastTry << tried << ourLastTry << ignoreTill << stat2H | ||||
| << total << success << clientVersion << clientSubVersion | << stat8H << stat1D << stat1W << stat1M << total << success | ||||
| << blocks << ourLastSuccess << checkpointVerified; | << clientVersion << clientSubVersion << blocks << ourLastSuccess | ||||
| << checkpointVerified; | |||||
| info_stream >> info; | info_stream >> WithParams(CAddress::V1_DISK, info); | ||||
| info.Update(good); | info.Update(good); | ||||
| return info; | return info; | ||||
| } | } | ||||
| BOOST_AUTO_TEST_SUITE(db_tests) | BOOST_AUTO_TEST_SUITE(db_tests) | ||||
| BOOST_AUTO_TEST_CASE(seederaddrinfo_test) { | BOOST_AUTO_TEST_CASE(seederaddrinfo_test) { | ||||
| CService ip{ResolveIP("8.8.8.8"), uint16_t{1337}}; | CService ip{ResolveIP("8.8.8.8"), uint16_t{1337}}; | ||||
| ▲ Show 20 Lines • Show All 43 Lines • Show Last 20 Lines | |||||