0

I have written a script that will fail unless it receives both oref1 and oref2 as reference inputs. I have the following emulator code:

let rule = mempty
                     <> C.mustReferenceOutput oref1
                     <> C.mustReferenceOutput oref2
                     <> C.mustMintValue val 
                     <> (C.mustBeSignedBy ppkh)
tx <- mkTxConstraints @Void (plutusV2MintingPolicy policy) rule
submitTxConfirmed tx

The script fails saying that oref1 is not a reference input. But if I comment out C.mustReferenceOutput oref2 then the script fails saying it has not received oref2 as a reference input. It seems I can attach oref1 or oref2 as a reference input, but not both.

On the testnet, this issue does not occur, so it isn't a problem with the script. Is it not possible with the Plutus emulator to attach more than one reference input to a transaction?

1 Answer 1

0

It does work with the emulator. Here's a test that demonstrates this being validated on-chain.

https://github.com/input-output-hk/plutus-apps/blob/9bb44b617212fa195701f0c4a59d6f0e60b7764d/plutus-contract/test/Spec/Contract/Tx/Constraints/MustReferenceOutput.hs#L195-L196

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.