Introduce wrappers around CZCPaymentAddress
This patch removes the need for the intermediary Base58 type
CZCPaymentAddress, by providing {Encode,Decode}PaymentAddress
functions that directly operate on the conversion between strings
and libzcash::PaymentAddress.
This commit is contained in:
@@ -203,15 +203,15 @@ BOOST_AUTO_TEST_CASE(zc_address_test)
|
||||
{
|
||||
auto addr = sk.address();
|
||||
|
||||
CZCPaymentAddress paymentaddr(addr);
|
||||
string addr_string = paymentaddr.ToString();
|
||||
std::string addr_string = EncodePaymentAddress(addr);
|
||||
|
||||
BOOST_CHECK(addr_string[0] == 'z');
|
||||
BOOST_CHECK(addr_string[1] == 'c');
|
||||
|
||||
CZCPaymentAddress paymentaddr2(addr_string);
|
||||
auto paymentaddr2 = DecodePaymentAddress(addr_string);
|
||||
BOOST_ASSERT(static_cast<bool>(paymentaddr2));
|
||||
|
||||
PaymentAddress addr2 = paymentaddr2.Get();
|
||||
PaymentAddress addr2 = *paymentaddr2;
|
||||
BOOST_CHECK(addr.a_pk == addr2.a_pk);
|
||||
BOOST_CHECK(addr.pk_enc == addr2.pk_enc);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user