use thiserror::Error;
#[derive(Debug, Error)]
pub enum SessionError {
#[error(transparent)]
Keystore(#[from] dig_keystore::KeystoreError),
#[error("seed material must be non-empty")]
EmptySeed,
#[error(
"this account was stored under the legacy raw-seed format and cannot be \
read as BIP-39 entropy; re-enrol it from its 24-word recovery phrase"
)]
LegacySeedFormat,
#[error("unsupported seed-envelope version {0:#04x}; this build is too old to read it")]
UnsupportedEnvelopeVersion(u8),
#[error("unsupported stored seed kind {0:#04x}; this build is too old to read it")]
UnsupportedSeedKind(u8),
#[error(
"not a valid 24-word English BIP-39 recovery phrase (check the word \
count, spelling, and order)"
)]
InvalidRecoveryPhrase,
}
pub type Result<T> = std::result::Result<T, SessionError>;