The transaction has no unshield.
The last commitment is an unshield note. The contract checks it against unshieldPreimage.
The last commitment is an unshield note to msg.sender. Only the original recipient can submit it, and the contract pays the address in unshieldPreimage.
Unshield mode of a transaction, as the contract
UnshieldTypeenum.