From 2eae850fcdf08f341303a7529bec678b3979d023 Mon Sep 17 00:00:00 2001 From: violet360 Date: Thu, 3 Mar 2022 20:50:44 +0530 Subject: [PATCH] error for psbt out of bounds and some minor changes in docs --- src/util/psbt/error.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/util/psbt/error.rs b/src/util/psbt/error.rs index e4aa5b08bf..58a214d663 100644 --- a/src/util/psbt/error.rs +++ b/src/util/psbt/error.rs @@ -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 @@ -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 )