Changeset View
Changeset View
Standalone View
Standalone View
src/test/key_io_tests.cpp
Show First 20 Lines • Show All 118 Lines • ▼ Show 20 Lines | for (unsigned int idx = 0; idx < tests.size(); idx++) { | ||||
CKey key; | CKey key; | ||||
key.Set(exp_payload.begin(), exp_payload.end(), isCompressed); | key.Set(exp_payload.begin(), exp_payload.end(), isCompressed); | ||||
assert(key.IsValid()); | assert(key.IsValid()); | ||||
BOOST_CHECK_MESSAGE(EncodeSecret(key) == exp_base58string, | BOOST_CHECK_MESSAGE(EncodeSecret(key) == exp_base58string, | ||||
"result mismatch: " + strTest); | "result mismatch: " + strTest); | ||||
} else { | } else { | ||||
CTxDestination dest; | CTxDestination dest; | ||||
CScript exp_script(exp_payload.begin(), exp_payload.end()); | CScript exp_script(exp_payload.begin(), exp_payload.end()); | ||||
ExtractDestination(exp_script, dest); | BOOST_CHECK(ExtractDestination(exp_script, dest)); | ||||
std::string address = EncodeLegacyAddr(dest, Params()); | std::string address = EncodeLegacyAddr(dest, Params()); | ||||
BOOST_CHECK_EQUAL(address, exp_base58string); | BOOST_CHECK_EQUAL(address, exp_base58string); | ||||
} | } | ||||
} | } | ||||
SelectParams(CBaseChainParams::MAIN); | SelectParams(CBaseChainParams::MAIN); | ||||
} | } | ||||
Show All 37 Lines |