simplicity/policy/
error.rs1use std::fmt;
4
5pub enum Error {
6 InvalidSequence,
7 PublicKeyHash,
8 Sha256d,
9 Ripemd160,
10 Multisig,
11 Extensions,
12 CouldNotSatisfy,
13}
14
15impl fmt::Debug for Error {
16 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
17 match self {
18 Error::InvalidSequence => writeln!(f, "Sequence does not encode relative locktime"),
19 Error::PublicKeyHash => writeln!(f, "Public key hashes are not suppored"),
20 Error::Sha256d => writeln!(f, "Sha256d is not supported"),
21 Error::Ripemd160 => writeln!(f, "Ripemd160 is not supported"),
22 Error::Multisig => writeln!(f, "Multisig is not supported"),
23 Error::Extensions => writeln!(f, "Extensions are not supported"),
24 Error::CouldNotSatisfy => writeln!(f, "Could not satisfy the given policy"),
25 }
26 }
27}
28
29impl fmt::Display for Error {
30 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
31 fmt::Debug::fmt(self, f)
32 }
33}
34
35impl std::error::Error for Error {}