feat: more errors

This commit is contained in:
rvcas
2022-09-19 00:39:52 -04:00
parent 6e901de2f0
commit 9bab3187b1
5 changed files with 884 additions and 834 deletions

View File

@@ -2,6 +2,25 @@ use crate::machine;
#[derive(thiserror::Error, Debug)]
pub enum Error {
#[error("Runtime error")]
#[error("{0}")]
Address(#[from] pallas_addresses::Error),
#[error("Only shelley reward addresses can be a part of withdrawals")]
BadWithdrawalAddress,
#[error("{0}")]
FragmentDecode(#[from] pallas_primitives::Error),
#[error("{0}")]
Machine(#[from] machine::Error),
#[error("Can't eval without redeemers")]
NoRedeemers,
#[error("Mismatch in required redeemers: {} {}", .missing.join(" "), .extra.join(" "))]
RequiredRedeemersMismatch {
missing: Vec<String>,
extra: Vec<String>,
},
#[error("Resolved Input not found")]
ResolvedInputNotFound,
#[error("A key hash cannot be the hash of a script")]
ScriptKeyHash,
#[error("Wrong era, Please use Babbage or Alonzo: {0}")]
WrongEra(#[from] pallas_codec::minicbor::decode::Error),
}