Introduce wrappers around CZCSpendingKey

This commit is contained in:
Jack Grigg
2018-04-24 15:16:27 +01:00
parent 80ed13d545
commit 472f75bc2d
6 changed files with 50 additions and 27 deletions

View File

@@ -378,3 +378,18 @@ boost::optional<libzcash::PaymentAddress> DecodePaymentAddress(const std::string
return boost::none;
}
}
std::string EncodeSpendingKey(const libzcash::SpendingKey& zkey)
{
return CZCSpendingKey(zkey).ToString();
}
boost::optional<libzcash::SpendingKey> DecodeSpendingKey(const std::string& str)
{
CZCSpendingKey key(str);
try {
return key.Get();
} catch (const std::runtime_error&) {
return boost::none;
}
}