Working through the Plutus Pioneer Week2 homework and getting the following error in the locally served playground.
error:
• Couldn't match expected type ‘BuiltinData’
with actual type ‘PlutusTx.Data’
• In the second argument of ‘($)’, namely ‘PlutusTx.toData bs’
In the second argument of ‘($)’, namely
‘Redeemer $ PlutusTx.toData bs’
In the expression:
mustSpendScriptOutput oref $ Redeemer $ PlutusTx.toData bs
|
77 | tx = mconcat [mustSpendScriptOutput oref $ Redeemer $ PlutusTx.toData bs | oref <- orefs]
|
Validator code in question
import Plutus.Contract
import qualified PlutusTx
import PlutusTx.Prelude hiding (Semigroup(..), unless)
...
grab :: forall w s e. AsContractError e => (Bool, Bool) -> Contract w s e ()
grab bs = do
utxos <- utxoAt scrAddress
let orefs = fst <$> Map.toList utxos
lookups = Constraints.unspentOutputs utxos <>
Constraints.otherScript validator
tx :: TxConstraints Void Void
tx = mconcat [mustSpendScriptOutput oref $ Redeemer $ PlutusTx.toData bs | oref <- orefs]
ledgerTx <- submitTxConstraintsWith @Void lookups tx
void $ awaitTxConfirmed $ txId ledgerTx
logInfo @String $ "collected gifts"