Changeset View
Changeset View
Standalone View
Standalone View
src/test/dstencode_tests.cpp
Show All 31 Lines | BOOST_AUTO_TEST_CASE(test_addresses) { | ||||
std::vector<uint8_t> hash = {118, 160, 64, 83, 189, 160, 168, | std::vector<uint8_t> hash = {118, 160, 64, 83, 189, 160, 168, | ||||
139, 218, 81, 119, 184, 106, 21, | 139, 218, 81, 119, 184, 106, 21, | ||||
195, 178, 159, 85, 152, 115}; | 195, 178, 159, 85, 152, 115}; | ||||
const CTxDestination dstKey = PKHash(uint160(hash)); | const CTxDestination dstKey = PKHash(uint160(hash)); | ||||
const CTxDestination dstScript = ScriptHash(uint160(hash)); | const CTxDestination dstScript = ScriptHash(uint160(hash)); | ||||
std::string cashaddr_pubkey = | std::string cashaddr_pubkey = | ||||
"bitcoincash:qpm2qsznhks23z7629mms6s4cwef74vcwvy22gdx6a"; | "abc:qpm2qsznhks23z7629mms6s4cwef74vcwvjr9zzhs3"; | ||||
std::string cashaddr_script = | std::string cashaddr_script = | ||||
"bitcoincash:ppm2qsznhks23z7629mms6s4cwef74vcwvn0h829pq"; | "abc:ppm2qsznhks23z7629mms6s4cwef74vcwv9xcd95tv"; | ||||
std::string base58_pubkey = "1BpEi6DfDAUFd7GtittLSdBeYJvcoaVggu"; | std::string base58_pubkey = "1BpEi6DfDAUFd7GtittLSdBeYJvcoaVggu"; | ||||
std::string base58_script = "3CWFddi6m4ndiGyKqzYvsFYagqDLPVMTzC"; | std::string base58_script = "3CWFddi6m4ndiGyKqzYvsFYagqDLPVMTzC"; | ||||
DummyCashAddrConfig config; | DummyCashAddrConfig config; | ||||
// Check encoding | // Check encoding | ||||
config.SetCashAddrEncoding(true); | config.SetCashAddrEncoding(true); | ||||
BOOST_CHECK_EQUAL(cashaddr_pubkey, EncodeDestination(dstKey, config)); | BOOST_CHECK_EQUAL(cashaddr_pubkey, EncodeDestination(dstKey, config)); | ||||
Show All 21 Lines |