signedHash :: Script -> PrivateKey -> Transaction -> Signature
signedHash oldInputScript privateKey intermediateTransaction = fromMaybe
  (error "Unable to sign hash")
  (signWith 100 privateKey SHA256 intermediateHash')
  where intermediateHash' = intermediateHash intermediateTransaction oldInputScript
signedHash :: Script -> PrivateKey -> Transaction -> Signature
signedHash oldInputScript privateKey intermediateTransaction = fromMaybe
  (error "Unable to sign hash")
  (signWith 100 privateKey SHA256 intermediateHash')
  where intermediateHash' = intermediateHash intermediateTransaction oldInputScript
signedHash oldInputScript privateKey intermediateTransaction = fromMaybe
  (error "Unable to sign hash")
  (signWith 100 privateKey SHA256 intermediateHash')
  where intermediateHash' = intermediateHash intermediateTransaction oldInputScript