Replace boost with C++17 std equivalents, upgrade LZ4 to 1.10.0
- boost::tuple → std::tuple (serialize.h, miner.cpp, script.cpp, walletdb.cpp) - boost::shared_ptr → std::shared_ptr (trianglesrpc.cpp) - boost::variant → std::variant for CTxDestination (script.h) - boost::get → std::get_if (main.cpp, rpcblockchain.cpp, coincontroldialog.cpp, wallet.cpp) - boost::apply_visitor → std::visit (base58.h, script.cpp, rpcwallet.cpp, test/base58_tests.cpp) - boost::static_visitor removed from all visitor classes - boost::lexical_cast → std::to_string/std::stoll (smessage.cpp, rpcsmessage.cpp) - Removed unused boost/lexical_cast.hpp includes (rest.cpp, trianglesrpc.cpp) - Removed boost/variant/get.hpp include (rpcdump.cpp) - Upgraded vendored LZ4 from 1.1.3 to 1.10.0 - Updated LZ4_compress() → LZ4_compress_default() (smessage.cpp) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -58,7 +58,7 @@ BOOST_AUTO_TEST_CASE(base58_DecodeBase58)
|
||||
}
|
||||
|
||||
// Visitor to check address type
|
||||
class TestAddrTypeVisitor : public boost::static_visitor<bool>
|
||||
class TestAddrTypeVisitor
|
||||
{
|
||||
private:
|
||||
std::string exp_addrType;
|
||||
@@ -79,7 +79,7 @@ public:
|
||||
};
|
||||
|
||||
// Visitor to check address payload
|
||||
class TestPayloadVisitor : public boost::static_visitor<bool>
|
||||
class TestPayloadVisitor
|
||||
{
|
||||
private:
|
||||
std::vector<unsigned char> exp_payload;
|
||||
@@ -150,7 +150,7 @@ BOOST_AUTO_TEST_CASE(base58_keys_valid_parse)
|
||||
BOOST_CHECK_MESSAGE(addr.IsValid(), "!IsValid:" + strTest);
|
||||
BOOST_CHECK_MESSAGE(addr.IsScript() == (exp_addrType == "script"), "isScript mismatch" + strTest);
|
||||
CTxDestination dest = addr.Get();
|
||||
BOOST_CHECK_MESSAGE(boost::apply_visitor(TestAddrTypeVisitor(exp_addrType), dest), "addrType mismatch" + strTest);
|
||||
BOOST_CHECK_MESSAGE(std::visit(TestAddrTypeVisitor(exp_addrType), dest), "addrType mismatch" + strTest);
|
||||
|
||||
// Public key must be invalid private key
|
||||
secret.SetString(exp_base58string);
|
||||
@@ -213,7 +213,7 @@ BOOST_AUTO_TEST_CASE(base58_keys_valid_gen)
|
||||
continue;
|
||||
}
|
||||
CTrianglesAddress addrOut;
|
||||
BOOST_CHECK_MESSAGE(boost::apply_visitor(CTrianglesAddressVisitor(&addrOut), dest), "encode dest: " + strTest);
|
||||
BOOST_CHECK_MESSAGE(std::visit(CTrianglesAddressVisitor(&addrOut), dest), "encode dest: " + strTest);
|
||||
BOOST_CHECK_MESSAGE(addrOut.ToString() == exp_base58string, "mismatch: " + strTest);
|
||||
}
|
||||
}
|
||||
@@ -221,7 +221,7 @@ BOOST_AUTO_TEST_CASE(base58_keys_valid_gen)
|
||||
// Visiting a CNoDestination must fail
|
||||
CTrianglesAddress dummyAddr;
|
||||
CTxDestination nodest = CNoDestination();
|
||||
BOOST_CHECK(!boost::apply_visitor(CTrianglesAddressVisitor(&dummyAddr), nodest));
|
||||
BOOST_CHECK(!std::visit(CTrianglesAddressVisitor(&dummyAddr), nodest));
|
||||
|
||||
// Restore global state
|
||||
fTestNet = fTestNet_stored;
|
||||
|
||||
Reference in New Issue
Block a user