1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
use crate::PublicKeyErrors;
use crate::PrivateKeyErrors;
use anyhow::*;
use snafu::*;

#[derive(Debug, Snafu)]
pub enum ExtendedPrivateKeyErrors {
  #[snafu(display("Could not generate randomness: {}", error))]
  RandomnessGenerationError { error: anyhow::Error },
  #[snafu(display("Could not calculate private key bytes from seed: {}", error))]
  InvalidSeedHmacError { error: anyhow::Error },
  #[snafu(display("Could not calculate private key: {}", error))]
  InvalidPrivateKeyError { error: PrivateKeyErrors },
  #[snafu(display("Could not calculate public key: {}", error))]
  InvalidPublicKeyError { error: PublicKeyErrors },
  #[snafu(display("Could not serialise xpriv: {}", error))]
  SerialisationError { error: anyhow::Error },

  #[snafu(display("Could not derive xpriv: {}", error))]
  DerivationError { error: anyhow::Error },
}