scalus
scalus copied to clipboard
Remove default from Spend Step witness and fix WrongOutputType.explain
The Spend step has a default pubkey witness, which makes it easy to forget to provide a real witness when spending a script utxo.
Also, the error explain for WrongOutputType with how we use it in this function.
I suggest something like
case class WrongOutputType(
expectedType: WitnessKind,
utxo: TransactionUnspentOutput
) extends StepError {
override def explain: String =
s"The UTxO you provided has the wrong type. We require a `$expectedType`. " +
s"UTxO: $utxo"
}
instead.
#163 updates the message