use crate::core::libtx;
use crate::keychain;
use crate::libwallet;
use crate::util::secp;
use grin_wallet_util::OnionV3AddressError;
#[derive(Clone, thiserror::Error, Eq, PartialEq, Debug)]
pub enum Error {
#[error("LibTx Error")]
LibTX(#[from] libtx::Error),
#[error("LibWallet Error: {0}")]
LibWallet(#[from] libwallet::Error),
#[error("Keychain error")]
Keychain(#[from] keychain::Error),
#[error("Onion V3 Address Error")]
OnionV3Address(#[from] OnionV3AddressError),
#[error("Unable to find obfs4proxy binary in your path; {}", _0)]
Obfs4proxyBin(String),
#[error("Bridge line is in bad format; {}", _0)]
BridgeLine(String),
#[error("IO error")]
IO,
#[error("Secp error")]
Secp(#[from] secp::Error),
#[error("Serde JSON error")]
Format,
#[error("Wallet seed file exists: {}", _0)]
WalletSeedExists(String),
#[error("Wallet seed doesn't exist error")]
WalletSeedDoesntExist,
#[error("Wallet doesn't exist at {}. {}", _0, _1)]
WalletDoesntExist(String, String),
#[error("Enc/Decryption error (check password?)")]
Encryption,
#[error("BIP39 Mnemonic (word list) Error")]
Mnemonic,
#[error("{}", _0)]
ArgumentError(String),
#[error("Tor Bridge Error: {}", _0)]
TorBridge(String),
#[error("Tor Proxy Error: {}", _0)]
TorProxy(String),
#[error("Error generating ed25519 secret key: {}", _0)]
ED25519Key(String),
#[error("Address is not an Onion v3 Address: {}", _0)]
NotOnion(String),
#[error("Generic error: {}", _0)]
GenericError(String),
}