libzcash::PaymentAddress has been renamed to libzcash::SproutPaymentAddress, and a new typedef boost::variant is now libzcash::PaymentAddress. Similarly for ViewingKey and SpendingKey. A new class InvalidEncoding is introduced as the default boost::variant option for each address and key type; it is used during decoding instead of boost::optional. All address and key storage functions in the wallet have been modified to refer specifically to the Sprout types, as they are used very precisely. In most other cases, the more general type is leveraged as much as possible, and we convert to the Sprout type when necessary. This will be subsequently wrapped in, or replaced with, context-specific functions once Sapling types are implemented.
42 lines
1.5 KiB
C++
42 lines
1.5 KiB
C++
// Copyright (c) 2009-2010 Satoshi Nakamoto
|
|
// Copyright (c) 2009-2015 The Bitcoin Core developers
|
|
// Copyright (c) 2016-2018 The Zcash developers
|
|
// Distributed under the MIT software license, see the accompanying
|
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
|
|
#ifndef BITCOIN_KEYIO_H
|
|
#define BITCOIN_KEYIO_H
|
|
|
|
#include <chainparams.h>
|
|
#include <key.h>
|
|
#include <pubkey.h>
|
|
#include <script/standard.h>
|
|
#include <zcash/Address.hpp>
|
|
|
|
#include <string>
|
|
|
|
CKey DecodeSecret(const std::string& str);
|
|
std::string EncodeSecret(const CKey& key);
|
|
|
|
CExtKey DecodeExtKey(const std::string& str);
|
|
std::string EncodeExtKey(const CExtKey& extkey);
|
|
CExtPubKey DecodeExtPubKey(const std::string& str);
|
|
std::string EncodeExtPubKey(const CExtPubKey& extpubkey);
|
|
|
|
std::string EncodeDestination(const CTxDestination& dest);
|
|
CTxDestination DecodeDestination(const std::string& str);
|
|
bool IsValidDestinationString(const std::string& str);
|
|
bool IsValidDestinationString(const std::string& str, const CChainParams& params);
|
|
|
|
std::string EncodePaymentAddress(const libzcash::PaymentAddress& zaddr);
|
|
libzcash::PaymentAddress DecodePaymentAddress(const std::string& str);
|
|
bool IsValidPaymentAddressString(const std::string& str);
|
|
|
|
std::string EncodeViewingKey(const libzcash::ViewingKey& vk);
|
|
libzcash::ViewingKey DecodeViewingKey(const std::string& str);
|
|
|
|
std::string EncodeSpendingKey(const libzcash::SpendingKey& zkey);
|
|
libzcash::SpendingKey DecodeSpendingKey(const std::string& str);
|
|
|
|
#endif // BITCOIN_KEYIO_H
|