|
|
@@ -9,15 +9,6 @@ pub type Result<T> = std::result::Result<T, Error>;
|
|
|
#[derive(Debug, Clone)]
|
|
|
|
|
|
pub enum Error {
|
|
|
- Foo,
|
|
|
- CommitsDontAdd,
|
|
|
- InvalidCredential,
|
|
|
- TransactionPedersenCheckFailed,
|
|
|
- TokenAlreadySpent,
|
|
|
- InputTokenVerifyFailed,
|
|
|
- RangeproofPedersenMatchFailed,
|
|
|
- ProofsFailed,
|
|
|
- MissingProofs,
|
|
|
Io(std::io::ErrorKind),
|
|
|
/// VarInt was encoded in a non-minimal way
|
|
|
NonMinimalVarInt,
|
|
|
@@ -54,19 +45,6 @@ impl std::error::Error for Error {}
|
|
|
impl fmt::Display for Error {
|
|
|
fn fmt(&self, f: &mut fmt::Formatter) -> std::fmt::Result {
|
|
|
match *self {
|
|
|
- Error::Foo => f.write_str("foo"),
|
|
|
- Error::CommitsDontAdd => f.write_str("Commits don't add up properly"),
|
|
|
- Error::InvalidCredential => f.write_str("Credential is invalid"),
|
|
|
- Error::TransactionPedersenCheckFailed => {
|
|
|
- f.write_str("Transaction pedersens for input and output don't sum up")
|
|
|
- }
|
|
|
- Error::TokenAlreadySpent => f.write_str("This input token is already spent"),
|
|
|
- Error::InputTokenVerifyFailed => f.write_str("Input token verify of credential failed"),
|
|
|
- Error::RangeproofPedersenMatchFailed => {
|
|
|
- f.write_str("Rangeproof pedersen check for match failed")
|
|
|
- }
|
|
|
- Error::ProofsFailed => f.write_str("Proof validation failed"),
|
|
|
- Error::MissingProofs => f.write_str("Missing proofs"),
|
|
|
Error::Io(ref err) => write!(f, "io error:{:?}", err),
|
|
|
Error::NonMinimalVarInt => f.write_str("non-minimal varint"),
|
|
|
Error::ParseFailed(ref err) => write!(f, "parse failed: {}", err),
|
|
|
@@ -164,4 +142,3 @@ impl From<state::VerifyFailed> for Error {
|
|
|
Error::VerifyFailed
|
|
|
}
|
|
|
}
|
|
|
-
|