X-Git-Url: https://repo.jachan.dev/VerusCoin.git/blobdiff_plain/ceb4559eac88f7effc28b23b5deae8b9a5c9e98a..8209bfc49283dc694e8f555b7111bb0d9ebec907:/src/base58.h diff --git a/src/base58.h b/src/base58.h index 24e7abfc8..cfca19bb3 100644 --- a/src/base58.h +++ b/src/base58.h @@ -1,7 +1,7 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2014 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying -// file COPYING or http://www.opensource.org/licenses/mit-license.php. +// file COPYING or https://www.opensource.org/licenses/mit-license.php . /** * Why base-58 instead of standard base-64 encoding? @@ -14,13 +14,13 @@ #ifndef BITCOIN_BASE58_H #define BITCOIN_BASE58_H -#include "chainparams.h" #include "key.h" #include "pubkey.h" #include "script/script.h" #include "script/standard.h" #include "support/allocators/zeroafterfree.h" #include "zcash/Address.hpp" +#include "chainparams.h" #include #include @@ -58,13 +58,13 @@ std::string EncodeBase58Check(const std::vector& vchIn); * Decode a base58-encoded string (psz) that includes a checksum into a byte * vector (vchRet), return true if decoding is successful */ -inline bool DecodeBase58Check(const char* psz, std::vector& vchRet); +bool DecodeBase58Check(const char* psz, std::vector& vchRet); /** * Decode a base58-encoded string (str) that includes a checksum into a byte * vector (vchRet), return true if decoding is successful */ -inline bool DecodeBase58Check(const std::string& str, std::vector& vchRet); +bool DecodeBase58Check(const std::string& str, std::vector& vchRet); /** * Base class for all base58-encoded data @@ -107,39 +107,6 @@ public: DATA_TYPE Get() const; }; -class CZCPaymentAddress : public CZCEncoding { -protected: - std::string PrependName(const std::string& s) const { return "payment address" + s; } - -public: - CZCPaymentAddress() {} - - CZCPaymentAddress(const std::string& strAddress) { SetString(strAddress.c_str(), 2); } - CZCPaymentAddress(const libzcash::PaymentAddress& addr) { Set(addr); } -}; - -class CZCViewingKey : public CZCEncoding { -protected: - std::string PrependName(const std::string& s) const { return "viewing key" + s; } - -public: - CZCViewingKey() {} - - CZCViewingKey(const std::string& strViewingKey) { SetString(strViewingKey.c_str(), 3); } - CZCViewingKey(const libzcash::ViewingKey& vk) { Set(vk); } -}; - -class CZCSpendingKey : public CZCEncoding { -protected: - std::string PrependName(const std::string& s) const { return "spending key" + s; } - -public: - CZCSpendingKey() {} - - CZCSpendingKey(const std::string& strAddress) { SetString(strAddress.c_str(), 2); } - CZCSpendingKey(const libzcash::SpendingKey& addr) { Set(addr); } -}; - /** base58-encoded Bitcoin addresses. * Public-key-hash-addresses have version 0 (or 111 testnet). * The data vector contains RIPEMD160(SHA256(pubkey)), where pubkey is the serialized public key. @@ -149,7 +116,11 @@ public: class CBitcoinAddress : public CBase58Data { public: bool Set(const CKeyID &id); + bool Set(const CPubKey &key); bool Set(const CScriptID &id); + bool Set(const CIdentityID& id); + bool Set(const CIndexID &id); + bool Set(const CQuantumID &id); bool Set(const CTxDestination &dest); bool IsValid() const; bool IsValid(const CChainParams ¶ms) const; @@ -163,7 +134,11 @@ public: CTxDestination Get() const; bool GetKeyID(CKeyID &keyID) const; + bool GetIdentityID(CIdentityID &idID) const; + bool GetKeyID_NoCheck(CKeyID& keyID) const; + bool GetIndexKey(uint160& hashBytes, int& type) const; bool IsScript() const; + bool IsIdentity() const; }; /**