From be008aeaf21539db162685108587dcda753bea6c Mon Sep 17 00:00:00 2001 From: Duke Leto Date: Tue, 5 Jun 2018 20:44:54 +0000 Subject: [PATCH] Add some missing viewkey methods that cause compile errors, unrelated but necessary --- src/zcash/Address.cpp | 12 ++++++++++++ src/zcash/Address.hpp | 9 +++++++++ 2 files changed, 21 insertions(+) diff --git a/src/zcash/Address.cpp b/src/zcash/Address.cpp index baefeae4e..1c8dbf2de 100644 --- a/src/zcash/Address.cpp +++ b/src/zcash/Address.cpp @@ -37,3 +37,15 @@ 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; +} diff --git a/src/zcash/Address.hpp b/src/zcash/Address.hpp index 2dbe10a60..558777e50 100644 --- a/src/zcash/Address.hpp +++ b/src/zcash/Address.hpp @@ -88,4 +88,13 @@ public: } +/** 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_