diff --git a/zebra-chain/src/orchard/keys.rs b/zebra-chain/src/orchard/keys.rs index cfe0c947..4e367da3 100644 --- a/zebra-chain/src/orchard/keys.rs +++ b/zebra-chain/src/orchard/keys.rs @@ -468,17 +468,6 @@ impl fmt::Display for IncomingViewingKey { } } -impl From<[u8; 32]> for IncomingViewingKey { - /// Generate an _IncomingViewingKey_ from existing bytes. - fn from(bytes: [u8; 32]) -> Self { - Self { - // TODO: handle setting the Network better. - network: Network::default(), - scalar: pallas::Scalar::from_bytes(&bytes).unwrap(), - } - } -} - impl From for IncomingViewingKey { /// Commit^ivk_rivk(ak, nk) := /// SinsemillaShortCommit_rcm (︁"z.cash:Orchard-CommitIvk", I2LEBSP_l(ak) || I2LEBSP_l(nk)︁) mod r_P @@ -542,6 +531,16 @@ impl PartialEq<[u8; 32]> for IncomingViewingKey { } } +impl IncomingViewingKey { + /// Generate an _IncomingViewingKey_ from existing bytes and a network variant. + fn from_bytes(bytes: [u8; 32], network: Network) -> Self { + Self { + network, + scalar: pallas::Scalar::from_bytes(&bytes).unwrap(), + } + } +} + /// Magic human-readable strings used to identify what networks Orchard full /// viewing keys are associated with when encoded/decoded with bech32. ///