Move ovk to be derived from fvk instead of the spending key

This commit is contained in:
Jack Grigg 2021-02-08 15:01:34 +00:00
parent 1add6a7ef0
commit bf9e77b629
1 changed files with 17 additions and 14 deletions

View File

@ -39,17 +39,6 @@ impl From<&SpendingKey> for NullifierDerivingKey {
}
}
/// A key that provides the capability to recover outgoing transaction information from
/// the block chain.
#[derive(Debug)]
pub struct OutgoingViewingKey;
impl From<&SpendingKey> for OutgoingViewingKey {
fn from(_: &SpendingKey) -> Self {
todo!()
}
}
/// A key that provides the capability to view incoming and outgoing transactions.
///
/// This key is useful anywhere you need to maintain accurate balance, but do not want the
@ -60,7 +49,7 @@ impl From<&SpendingKey> for OutgoingViewingKey {
pub struct FullViewingKey {
ak: AuthorizingKey,
nk: NullifierDerivingKey,
ovk: OutgoingViewingKey,
rivk: (),
}
impl From<&SpendingKey> for FullViewingKey {
@ -87,8 +76,8 @@ pub struct Diversifier([u8; 11]);
/// This key is useful in situations where you only need the capability to detect inbound
/// payments, such as merchant terminals.
///
/// This key is not suitable for use in a wallet, as it cannot maintain accurate balance.
/// You should use a [`FullViewingKey`] instead.
/// This key is not suitable for use on its own in a wallet, as it cannot maintain
/// accurate balance. You should use a [`FullViewingKey`] instead.
#[derive(Debug)]
pub struct IncomingViewingKey;
@ -104,3 +93,17 @@ impl IncomingViewingKey {
todo!()
}
}
/// A key that provides the capability to recover outgoing transaction information from
/// the block chain.
///
/// This key is not suitable for use on its own in a wallet, as it cannot maintain
/// accurate balance. You should use a [`FullViewingKey`] instead.
#[derive(Debug)]
pub struct OutgoingViewingKey;
impl From<&FullViewingKey> for OutgoingViewingKey {
fn from(_: &FullViewingKey) -> Self {
todo!()
}
}