Merge pull request #239 from nuttycom/di_from_bytes

Add construction of DiversifierIndex directly from bytes.
This commit is contained in:
str4d 2021-11-29 17:46:44 +00:00 committed by GitHub
commit 68b790c7da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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 {