user5565: Spoiler, so don't look if you haven't done the homework yet.
In the solution file Solution2.hs we have
checkSig :: Bool
checkSig = unPaymentPubKeyHash pkh `elem` txInfoSignatories info

while in the file from the lecture Vesting.hs we have the same check implemented as
signedByBeneficiary :: Bool
signedByBeneficiary = txSignedBy info $ unPaymentPubKeyHash $ beneficiary dat

I get the same behavior in the playground with the two implementations in Solution2.hs, and moreover looking at the implementation of txSignedBy
{-# INLINABLE txSignedBy #-}
-- | Check if a transaction was signed by the given public key.
txSignedBy :: TxInfo -> PubKeyHash -> Bool
txSignedBy TxInfo{txInfoSignatories} k = case find ((==) k) txInfoSignatories of
    Just _  -> True
    Nothing -> False

I don't see a difference. Maybe my tests in the playground aren't good enough, but is there an example of different behavior?

user6292: They are the same. I'd say the signedByBeneficiary way is more idiomatic.

5565: <p>Spoiler, so don't look if you haven't done the homework yet.</p>
<p>In the solution file Solution2.hs we have</p>
<pre><code>checkSig :: Bool
checkSig = unPaymentPubKeyHash pkh `elem` txInfoSignatories info
</code></pre>
<p>while in the file from the lecture Vesting.hs we have the same check implemented as</p>
<pre><code>signedByBeneficiary :: Bool
signedByBeneficiary = txSignedBy info $ unPaymentPubKeyHash $ beneficiary dat
</code></pre>
<p>I get the same behavior in the playground with the two implementations in Solution2.hs, and moreover looking at the implementation of txSignedBy</p>
<pre><code>{-# INLINABLE txSignedBy #-}
-- | Check if a transaction was signed by the given public key.
txSignedBy :: TxInfo -&gt; PubKeyHash -&gt; Bool
txSignedBy TxInfo{txInfoSignatories} k = case find ((==) k) txInfoSignatories of
    Just _  -&gt; True
    Nothing -&gt; False
</code></pre>
<p>I don't see a difference. Maybe my tests in the playground aren't good enough, but is there an example of different behavior?</p>
 6292: <p>They are the same. I'd say the <code>signedByBeneficiary</code> way is more idiomatic.</p>
