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
[X] Plutus Foundation Related to the GHC plugin, Haskell-to-Plutus compiler, on-chain code
[] Plutus Application Framework Related to the Plutus application backend (PAB), emulator, Plutus libraries
[] Marlowe Related to Marlowe
[] Other Any other topic (Playgrounds, etc.)
Summary
When validating a spending transaction, the Datums of the spent inputs are not available via ScriptContext.
Precisely:
The txOutDatumHash in the txInfoInputs (from ScriptContext) gives back a hash, so Just ...
Can be verified by viewing the Tx returned by submiTx...
Steps to reproduce
(see attachments for an example demonstrating the issue)
Build a contract which creates two UTxO with a Datum
Create another transaction which spends both UTxO and
try to access all Datum of all input UTxO via the ScriptContext
Expected behavior
According to a discussion with @brunjlar (pioneer discord), all input Datum should be available per default via the ScriptContext in on-chain validation.
Maybe it would be worth to update the documentation on txInfoData in TxInfo (there is none at the moment)
System info (please complete the following information):
OS: macOS Big Sur
Version: 11.2.3
Plutus version or commit hash: master branch, commit, 2087467
Note: Latest version of this file already applies the workaround from the next section
Additional context
Workaround: By using mustIncludeDatum, the Datum of the inputs can be made available to the transaction and be validated on-chain (by using the findDatum). See latest InputTxDatumsIssue.hs
The text was updated successfully, but these errors were encountered:
Area
[X] Plutus Foundation Related to the GHC plugin, Haskell-to-Plutus compiler, on-chain code
[] Plutus Application Framework Related to the Plutus application backend (PAB), emulator, Plutus libraries
[] Marlowe Related to Marlowe
[] Other Any other topic (Playgrounds, etc.)
Summary
When validating a spending transaction, the
Datum
s of the spent inputs are not available viaScriptContext
.Precisely:
txOutDatumHash
in thetxInfoInputs
(fromScriptContext
) gives back a hash, soJust ...
findDatum
in Plutus.V1.Ledger.Contexts returnsNothing
txInfoData
Tx
returned bysubmiTx...
Steps to reproduce
(see attachments for an example demonstrating the issue)
Datum
Datum
of all input UTxO via theScriptContext
Expected behavior
Datum
should be available per default via theScriptContext
in on-chain validation.txInfoData
inTxInfo
(there is none at the moment)System info (please complete the following information):
Screenshots and attachments
Additional context
mustIncludeDatum
, theDatum
of the inputs can be made available to the transaction and be validated on-chain (by using thefindDatum
). See latest InputTxDatumsIssue.hsThe text was updated successfully, but these errors were encountered: