Validator fails to recognize equivalent public key hashes

I have a simple validator script that checks if a transaction is signed by a specific public key with the hash: 12f2f3e44e6e310abc78802d7078ec1fd0fa220ff47ad1bdb43397e2

{-# INLINABLE getHolder #-}
getHolder :: PubKeyHash
getHolder = PubKeyHash "12f2f3e44e6e310abc78802d7078ec1fd0fa220ff47ad1bdb43397e2"


{-# INLINABLE mkValidator #-}
mkValidator :: BuiltinData -> BuiltinData -> ScriptContext -> Bool
mkValidator _ _ ctx = txSignedBy (scriptContextTxInfo ctx) getHolder

The validator always fails when attempting to spend an output with the correct key using the CLI, --required-signer is being used. The transaction is never built.


I attempt to log the txInfoSignatories in the validator using the following code:

{-# INLINABLE mkValidator #-}
mkValidator :: BuiltinData -> BuiltinData -> ScriptContext -> Bool
mkValidator _ _ ctx = traceError $ decodeUtf8 $ getPubKeyHash $ P.head signatories
    where
        info :: TxInfo
        info = scriptContextTxInfo ctx

        signatories :: [PubKeyHash]
        signatories = txInfoSignatories info

Even though the decoding function throws an error, I still get the following:

The provided Plutus code called 'error'.
Caused by: [
  (builtin decodeUtf8)
  (con bytestring #12f2f3e44e6e310abc78802d7078ec1fd0fa220ff47ad1bdb43397e2)
]

Which shows that the correct key hash is in the script context, but the way the hash is constructed by the script context is clearly not the same as the one I’ve made and I’m not sure how to proceed.

Thanks!