I hope I can get help from someone on here. I built a minting transaction on preprod using Lucid that uses a validator that always pass, and I am stuck with this error:
error: Uncaught (in promise) Error: "transaction submit error ShelleyTxValidationError ShelleyBasedEraBabbage (ApplyTxError [UtxowFailure (FromAlonzoUtxowFail (MissingRedeemers [(Minting (PolicyID {policyID = ScriptHash \"e6584023b2579776600aaefc75c081ef027c5860a8dc7504b7b4d18c\"}),ScriptHash \"e6584023b2579776600aaefc75c081ef027c5860a8dc7504b7b4d18c\")])),UtxowFailure (FromAlonzoUtxowFail (PPViewHashesDontMatch SNothing (SJust (SafeHash \"75be5e37c2a7f07027713f0cf852aabedb84498d31182e96a4d2390dc2817d3f\")))),UtxowFailure (UtxoFailure (FromAlonzoUtxoFail (UtxosFailure (CollectErrors [NoRedeemer (Minting (PolicyID {policyID = ScriptHash \"e6584023b2579776600aaefc75c081ef027c5860a8dc7504b7b4d18c\"}))]))))])"
here is the built transaction:
.newTx()
.collectFrom([utxo], Data.void())
.attachMintingPolicy(into)
.attachMetadata("721", metadata)
.mintAssets({ [assetName]: BigInt(1) })
.payToContract(
contractAddress,
{ inline: Data.void() },
{ lovelace }
)
.complete();
const txSigned = await tx.sign().complete();
const txHash = await txSigned.submit();
After a thorough testing, I found that the problem is in .attachMintingPolicy (into)
where into
is the validator. Here is the validator definition:
const validator_ = JSON.parse(await Deno.readTextFile("plutus.json")).validators[0];
return {
type: "PlutusV2",
script: toHex(cbor.encode(fromHex(validator_.compiledCode))),
};
}
const validator = await readValidator();
corresponding aiken code:
validator {
fn store(datum: Data, context: Data) -> Bool {
1 == 1
}
}
Does anybody know what's going on? Thanks in advance.