Complete impl Arbitrary for TransmissionKey
This commit is contained in:
parent
abcca2c76b
commit
2156c6143b
|
@ -8,13 +8,20 @@ impl Arbitrary for TransmissionKey {
|
||||||
type Parameters = ();
|
type Parameters = ();
|
||||||
|
|
||||||
fn arbitrary_with(_args: Self::Parameters) -> Self::Strategy {
|
fn arbitrary_with(_args: Self::Parameters) -> Self::Strategy {
|
||||||
(array::uniform32(any::<u8>()))
|
(any::<SpendingKey>())
|
||||||
.prop_map(|_transmission_key_bytes| {
|
.prop_map(|spending_key| {
|
||||||
// TODO: actually generate something better than the identity.
|
let spend_authorizing_key = SpendAuthorizingKey::from(spending_key);
|
||||||
//
|
let proof_authorizing_key = ProofAuthorizingKey::from(spending_key);
|
||||||
// return Self::from_bytes(transmission_key_bytes);
|
|
||||||
|
|
||||||
return Self(jubjub::AffinePoint::identity());
|
let authorizing_key = AuthorizingKey::from(spend_authorizing_key);
|
||||||
|
let nullifier_deriving_key = NullifierDerivingKey::from(proof_authorizing_key);
|
||||||
|
|
||||||
|
let incoming_viewing_key =
|
||||||
|
IncomingViewingKey::from((authorizing_key, nullifier_deriving_key));
|
||||||
|
|
||||||
|
let diversifier = Diversifier::from(spending_key);
|
||||||
|
|
||||||
|
return Self::from(incoming_viewing_key, diversifier);
|
||||||
})
|
})
|
||||||
.boxed()
|
.boxed()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue