Skip to content

Commit

Permalink
error for psbt out of bounds and some minor changes in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
violet360 committed Mar 3, 2022
1 parent ad299ff commit 2eae850
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/util/psbt/error.rs
Expand Up @@ -37,11 +37,13 @@ pub enum Error {
/// Magic bytes for a PSBT must be the ASCII for "psbt" serialized in most
/// significant byte order.
InvalidMagic,
///
///
///Missing both the witness and non-witness utxo
MissingUtxo,
/// The separator for a PSBT must be `0xff`.
InvalidSeparator,
/// Triggered when output index goes out of bounds of when trying to get
/// output of non witness script
PsbtUtxoOutOfbounds,
/// Known keys must be according to spec.
InvalidKey(raw::Key),
/// Non-proprietary key type found when proprietary key was expected
Expand Down Expand Up @@ -101,7 +103,8 @@ impl fmt::Display for Error {
}
Error::NoMorePairs => f.write_str("no more key-value pairs for this psbt map"),
Error::HashParseError(e) => write!(f, "Hash Parse Error: {}", e),
Error::MissingUtxo => f.write_str("Utxo is missing"),
Error::MissingUtxo => f.write_str("UTXO information is not present in PSBT"),
Error::PsbtUtxoOutOfbounds => f.write_str("Output index is out of bounds of non witness script output array"),
Error::InvalidPreimageHashPair{ref preimage, ref hash, ref hash_type} => {
// directly using debug forms of psbthash enums
write!(f, "Preimage {:?} does not match {:?} hash {:?}", preimage, hash_type, hash )
Expand Down

0 comments on commit 2eae850

Please sign in to comment.