Browse Source

Viewing key changes are on their own branch now

pull/132/head
Duke Leto 6 years ago
parent
commit
2ce277db5d
  1. 12
      src/zcash/Address.cpp
  2. 22
      src/zcash/Address.hpp

12
src/zcash/Address.cpp

@ -37,15 +37,3 @@ PaymentAddress SpendingKey::address() const {
}
}
bool IsValidPaymentAddress(const libzcash::PaymentAddress& zaddr) {
return zaddr.which() != 0;
}
bool IsValidViewingKey(const libzcash::ViewingKey& vk) {
return vk.which() != 0;
}
bool IsValidSpendingKey(const libzcash::SpendingKey& zkey) {
return zkey.which() != 0;
}

22
src/zcash/Address.hpp

@ -4,16 +4,9 @@
#include "uint256.h"
#include "uint252.h"
#include "serialize.h"
#include <boost/variant.hpp>
namespace libzcash {
class InvalidEncoding {
public:
friend bool operator==(const InvalidEncoding &a, const InvalidEncoding &b) { return true; }
friend bool operator<(const InvalidEncoding &a, const InvalidEncoding &b) { return true; }
};
const size_t SerializedPaymentAddressSize = 64;
const size_t SerializedViewingKeySize = 64;
const size_t SerializedSpendingKeySize = 32;
@ -81,7 +74,7 @@ public:
}
};
class SproutSpendingKey : public uint252 {
class SpendingKey : public uint252 {
public:
SpendingKey() : uint252() { }
SpendingKey(uint252 a_sk) : uint252(a_sk) { }
@ -93,19 +86,6 @@ public:
PaymentAddress address() const;
};
typedef boost::variant<InvalidEncoding, SproutPaymentAddress> PaymentAddress;
typedef boost::variant<InvalidEncoding, SproutViewingKey> ViewingKey;
typedef boost::variant<InvalidEncoding, SproutSpendingKey> SpendingKey;
}
/** Check whether a PaymentAddress is not an InvalidEncoding. */
bool IsValidPaymentAddress(const libzcash::PaymentAddress& zaddr);
/** Check whether a ViewingKey is not an InvalidEncoding. */
bool IsValidViewingKey(const libzcash::ViewingKey& vk);
/** Check whether a SpendingKey is not an InvalidEncoding. */
bool IsValidSpendingKey(const libzcash::SpendingKey& zkey);
#endif // ZC_ADDRESS_H_

Loading…
Cancel
Save