pub fn from_raw_psbt(raw_psbt: &[u8]) -> Result<Self, TransactionSerialisationError> {
        let psbt = Decodable::consensus_decode(raw_psbt)?;
        let psbt = utils::psbt_common_sanity_checks(psbt)?;

        // Emergency txo
        let output_count = psbt.global.unsigned_tx.output.len();
        if output_count != 1 {
            return Err(PsbtValidationError::InvalidOutputCount(output_count).into());
        }

        let input_count = psbt.global.unsigned_tx.input.len();
        if input_count > 2 {
            return Err(PsbtValidationError::InvalidInputCount(input_count).into());
        }
        if input_count > 1 {
            let input = utils::find_feebumping_input(&psbt.inputs)
                .ok_or(PsbtValidationError::MissingFeeBumpingInput)?;
            utils::check_feebump_input(&input)?;
        }
        let input = utils::find_revocationtx_input(&psbt.inputs)
            .ok_or(PsbtValidationError::MissingRevocationInput)?;
        utils::check_revocationtx_input(&input)?;

        Ok(UnvaultEmergencyTransaction(psbt))
    }
/// Parse an UnvaultEmergency transaction from a PSBT
Parse an UnvaultEmergency transaction from a PSBT
Parse an UnvaultEmergency transaction from a PSBT
pub fn from_raw_psbt(raw_psbt: &[u8]) -> Result<Self, TransactionSerialisationError> {
        let psbt = Decodable::consensus_decode(raw_psbt)?;
        let psbt = utils::psbt_common_sanity_checks(psbt)?;
        // Emergency txo
        let output_count = psbt.global.unsigned_tx.output.len();
        if output_count != 1 {
            return Err(PsbtValidationError::InvalidOutputCount(output_count).into());
        }
        let input_count = psbt.global.unsigned_tx.input.len();
        if input_count > 2 {
            return Err(PsbtValidationError::InvalidInputCount(input_count).into());
        }
        if input_count > 1 {
            let input = utils::find_feebumping_input(&psbt.inputs)
                .ok_or(PsbtValidationError::MissingFeeBumpingInput)?;
            utils::check_feebump_input(&input)?;
        }
        let input = utils::find_revocationtx_input(&psbt.inputs)
            .ok_or(PsbtValidationError::MissingRevocationInput)?;
        utils::check_revocationtx_input(&input)?;
        Ok(UnvaultEmergencyTransaction(psbt))
    }
pub fn from_raw_psbt ( raw_psbt : & [ u8 ] ) -> Result < Self , TransactionSerialisationError > { let psbt = Decodable :: consensus_decode ( raw_psbt ) ? ; let psbt = utils :: psbt_common_sanity_checks ( psbt ) ? ; // Emergency txo let output_count = psbt . global . unsigned_tx . output . len ( ) ; if output_count != 1 { return Err ( PsbtValidationError :: InvalidOutputCount ( output_count ) . into ( ) ) ; } let input_count = psbt . global . unsigned_tx . input . len ( ) ; if input_count > 2 { return Err ( PsbtValidationError :: InvalidInputCount ( input_count ) . into ( ) ) ; } if input_count > 1 { let input = utils :: find_feebumping_input ( & psbt . inputs ) . ok_or ( PsbtValidationError :: MissingFeeBumpingInput ) ? ; utils :: check_feebump_input ( & input ) ? ; } let input = utils :: find_revocationtx_input ( & psbt . inputs ) . ok_or ( PsbtValidationError :: MissingRevocationInput ) ? ; utils :: check_revocationtx_input ( & input ) ? ; Ok ( UnvaultEmergencyTransaction ( psbt ) ) }
Parse an UnvaultEmergency transaction from a PSBT
Parse an UnvaultEmergency transaction from a PSBT
raw_psbt
&[u8]