You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 2, 2024. It is now read-only.
I try to test my contracts with functions toCardanoTxBody and evaulateTransactionExecutionUnits.
I build Plutus Tx by hand and convert it to cardano Tx to use evaluation function.
Something strange happens when I update datum from the input to output on the same address.
It can not find datum by datum hash. The function that I use to create part of Tx that pays to script:
--| Pay to the script.payToScript::ToData (DatumTypea) =>TypedValidatora->DatumTypea->Value->Tx
payToScript tv dat val =mempty
{ txOutputs = [TxOut (validatorAddress tv) val (Just dh)]
, txData =M.singleton dh datum
}
where
dh = datumHash datum
datum =Datum$ toBuiltinData dat
So it seems that I fill up txData and set up datum hash properly.
But when I use it in the code datum can only be found if it is the same as used in the inputs. If I change the datum validator can not find it in the outputs of TxInfo by hash although datum hash is present.
I tried to lookup how the function toCardanoTxBody works and I can see that it does not use txData.
Or maybe I miss something?
Please can you explain how txData should be used in the Cardano TxBody properly so that I can continue with my testing?
or how it should be used in toCardanoTxBody?
As I understand Cardano Tx does not contain datum's and only hashes are used.
How can the datums be visible to evaluateTransactionExecutionUnits?
I've tried to include also output datums in the UTxO argument of evaluateTransactionExecutionUnits and it also can not find them :(
The text was updated successfully, but these errors were encountered:
Thank you for raising this issue, we have a goal to resolve these discrepancies on our roadmap, and after we get there we would expect to see the datum handled the same on both testnet and emulation.
@cstml I'm aware of that. But we need to have some way to pass datums for validation.
And after conversion they are present for inputs but not for outputs.
Summary
I try to test my contracts with functions
toCardanoTxBody
andevaulateTransactionExecutionUnits
.I build Plutus
Tx
by hand and convert it to cardanoTx
to use evaluation function.Something strange happens when I update datum from the input to output on the same address.
It can not find datum by datum hash. The function that I use to create part of Tx that pays to script:
So it seems that I fill up
txData
and set up datum hash properly.But when I use it in the code datum can only be found if it is the same as used in the inputs. If I change the datum validator can not find it in the outputs of TxInfo by hash although datum hash is present.
I tried to lookup how the function
toCardanoTxBody
works and I can see that it does not usetxData
.Or maybe I miss something?
Please can you explain how
txData
should be used in the CardanoTxBody
properly so that I can continue with my testing?or how it should be used in
toCardanoTxBody
?As I understand Cardano Tx does not contain datum's and only hashes are used.
How can the datums be visible to
evaluateTransactionExecutionUnits
?I've tried to include also output datums in the
UTxO
argument ofevaluateTransactionExecutionUnits
and it also can not find them :(The text was updated successfully, but these errors were encountered: