Changeset View
Changeset View
Standalone View
Standalone View
src/test/base58_tests.cpp
Show First 20 Lines • Show All 230 Lines • ▼ Show 20 Lines | for (unsigned int idx = 0; idx < tests.size(); idx++) { | ||||
dest = CScriptID(uint160(exp_payload)); | dest = CScriptID(uint160(exp_payload)); | ||||
} else if (exp_addrType == "none") { | } else if (exp_addrType == "none") { | ||||
dest = CNoDestination(); | dest = CNoDestination(); | ||||
} else { | } else { | ||||
BOOST_ERROR("Bad addrtype: " << strTest); | BOOST_ERROR("Bad addrtype: " << strTest); | ||||
continue; | continue; | ||||
} | } | ||||
std::string address = EncodeDestination(dest); | std::string address = EncodeDestination(dest); | ||||
BOOST_CHECK_MESSAGE(address == exp_base58string, | BOOST_CHECK_MESSAGE(dest == DecodeDestination(address), | ||||
"mismatch: " + strTest); | "mismatch: " + strTest); | ||||
} | } | ||||
} | } | ||||
SelectParams(CBaseChainParams::MAIN); | SelectParams(CBaseChainParams::MAIN); | ||||
} | } | ||||
// Goal: check that base58 parsing code is robust against a variety of corrupted | // Goal: check that base58 parsing code is robust against a variety of corrupted | ||||
Show All 30 Lines |