Add construction of DiversifierIndex directly from bytes.

This commit is contained in:
Kris Nuttycombe 2021-11-24 18:08:53 -07:00
parent 465afd162e
commit 14c4b40dfc
1 changed files with 6 additions and 0 deletions

View File

@ -422,6 +422,12 @@ di_from!(u32);
di_from!(u64);
di_from!(usize);
impl From<[u8; 11]> for DiversifierIndex {
fn from(j_bytes: [u8; 11]) -> Self {
DiversifierIndex(j_bytes)
}
}
impl DiversifierKey {
/// Returns the diversifier at index 0.
pub fn default_diversifier(&self) -> Diversifier {