Remove Orchard spending key equality implementation.
This commit is contained in:
parent
bde245d8bc
commit
782c705cb1
|
@ -196,13 +196,6 @@ bool orchard_spending_key_serialize(
|
|||
OrchardFullViewingKeyPtr* orchard_spending_key_to_full_viewing_key(
|
||||
const OrchardSpendingKeyPtr* key);
|
||||
|
||||
/**
|
||||
* Implements equality testing between spending keys.
|
||||
*/
|
||||
bool orchard_spending_key_eq(
|
||||
const OrchardSpendingKeyPtr* k0,
|
||||
const OrchardSpendingKeyPtr* k1);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -285,10 +285,3 @@ pub extern "C" fn orchard_spending_key_to_full_viewing_key(
|
|||
.map(|key| Box::into_raw(Box::new(FullViewingKey::from(key))))
|
||||
.unwrap_or(std::ptr::null_mut())
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn orchard_spending_key_eq(k0: *const SpendingKey, k1: *const SpendingKey) -> bool {
|
||||
let k0 = unsafe { k0.as_ref() };
|
||||
let k1 = unsafe { k1.as_ref() };
|
||||
k0 == k1
|
||||
}
|
||||
|
|
|
@ -35,12 +35,16 @@ TEST(OrchardZkeysTest, FVKSerializationRoundtrip) {
|
|||
|
||||
TEST(OrchardZkeysTest, SKSerializationRoundtrip) {
|
||||
auto seed = MnemonicSeed::Random(1); //testnet coin type
|
||||
auto sk = libzcash::OrchardSpendingKey::ForAccount(seed, 1, 0);
|
||||
|
||||
auto sk = libzcash::OrchardSpendingKey::ForAccount(seed, 1, 0);
|
||||
CDataStream ss(SER_NETWORK, PROTOCOL_VERSION);
|
||||
ss << sk;
|
||||
std::string skStr = ss.str();
|
||||
|
||||
auto sk0 = libzcash::OrchardSpendingKey::Read(ss);
|
||||
CDataStream ss0(SER_NETWORK, PROTOCOL_VERSION);
|
||||
ss0 << sk0;
|
||||
std::string sk0Str = ss0.str();
|
||||
|
||||
ASSERT_EQ(sk, sk0);
|
||||
ASSERT_EQ(skStr, sk0Str);
|
||||
}
|
||||
|
|
|
@ -223,11 +223,6 @@ public:
|
|||
return *this;
|
||||
}
|
||||
|
||||
friend bool operator==(const OrchardSpendingKey& a, const OrchardSpendingKey& b)
|
||||
{
|
||||
return orchard_spending_key_eq(a.inner.get(), b.inner.get());
|
||||
}
|
||||
|
||||
template<typename Stream>
|
||||
void Serialize(Stream& s) const {
|
||||
RustStream rs(s);
|
||||
|
|
Loading…
Reference in New Issue