pub fn validate_expected_key_type(key: &PSBTKey, key_type: u8) -> Result<(), PSBTError> {
    if key.key_type() != key_type {
        Err(PSBTError::WrongKeyType {
            expected: key_type,
            got: key.key_type(),
        })
    } else {
        Ok(())
    }
}
/// Ensure that a key has the expected key type
Ensure that a key has the expected key type
Ensure that a key has the expected key type
pub fn validate_expected_key_type(key: &PSBTKey, key_type: u8) -> Result<(), PSBTError> {
    if key.key_type() != key_type {
        Err(PSBTError::WrongKeyType {
            expected: key_type,
            got: key.key_type(),
        })
    } else {
        Ok(())
    }
}
pub fn validate_expected_key_type ( key : & PSBTKey , key_type : u8 ) -> Result < ( ) , PSBTError > { if key . key_type ( ) != key_type { Err ( PSBTError :: WrongKeyType { expected : key_type , got : key . key_type ( ) , } ) } else { Ok ( ( ) ) } }
Ensure that a key has the expected key type
Ensure that a key has the expected key type
key
&PSBTKey
key_type
u8
key
&PSBTKey
key_type
u8