Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Local cluster Utxo Datum is missed #149

Closed
volodyad opened this issue Nov 26, 2021 · 3 comments
Closed

Local cluster Utxo Datum is missed #149

volodyad opened this issue Nov 26, 2021 · 3 comments
Labels
bug Something isn't working

Comments

@volodyad
Copy link

volodyad commented Nov 26, 2021

I have sent utxo with a datum to the script address
on simulator I can get _ciTxOutDatum, on local cluster it is empty

 utxos <- utxosAt addr
 let array = Map.toList utxos
 logInfo @String $ printf "array: %s "  (show array)

on simulator I have datum attached

_ciTxOutDatum = Right (Datum {getDatum = Constr 0 [List []]}

[(TxOutRef {txOutRefId = b0319b3cd31ac298ddd54c6a87ca16caac076631fc38ed357cf1a15e8fed90e3, txOutRefIdx = 1},
ScriptChainIndexTxOut {_ciTxOutAddress = Address {addressCredential = ScriptCredential 10e765a0e2d2a43f44aa5d141f070c205d9238d7a4fb2774e1c4109d, addressStakingCredential = Nothing}, _ciTxOutValidator = Left 10e765a0e2d2a43f44aa5d141f070c205d9238d7a4fb2774e1c4109d,
 _ciTxOutDatum = Right (Datum {getDatum = Constr 0 [List []]}), 
_ciTxOutValue = Value (Map [(,Map [(\"\",2000000)]),(f849fd58a770bbc58cca175b0c2ed467aad3bf3db2976e69ea399380,Map [(\"4e46544d61726b6574706c616365\",1)])])})] "

on local cluster no datum


 _ciTxOutDatum = Left c00d43b1f4284a9e5844a75f78e09225efd09060b88a625c22a6f7ac87382c4e

 [(TxOutRef {txOutRefId = 71863b2bc9aa0da3fa8980c87ad20ad656e02babe9e979e555302f8e331cd95c, txOutRefIdx = 0},
ScriptChainIndexTxOut {_ciTxOutAddress = Address {addressCredential = ScriptCredential b1a7bb4a317ac9eaa9ae05c7b80945a7b1218d86ea2fd376d2422767, addressStakingCredential = Nothing}, 
_ciTxOutValidator = Left b1a7bb4a317ac9eaa9ae05c7b80945a7b1218d86ea2fd376d2422767,
 _ciTxOutDatum = Left c00d43b1f4284a9e5844a75f78e09225efd09060b88a625c22a6f7ac87382c4e, 
_ciTxOutValue = Value (Map [(,Map [(\"\",2000000)]),(59b16e640832f82427711f5c1a22a55c4efe971c0dac73564b2f376f,Map [(\"4e46544d61726b6574706c616365\",1)])])})] "

Issue might be related with #139
Ae there any workarounds?

@volodyad volodyad added the bug Something isn't working label Nov 26, 2021
@volodyad volodyad changed the title Datum is missed Local cluster Datum is missed Nov 26, 2021
@volodyad volodyad changed the title Local cluster Datum is missed Local cluster Utxo Datum is missed Nov 26, 2021
@bhoudebert
Copy link

@volodyad does not seems like it.

You either get a hash or directly the datum. In case of hash you should be able to switch it to datum with the datumFromHash function.

Like it was said on the issue you mentioned, it may still be related to an under development phase. I would suggest to not waste too much time against testnet for smart contract for now as you will face a lot of issue that are simply related to roadmap not yet reached.

@olgaklimenko
Copy link

I have the same issue while testing PAB in the public testnet.

At first, I initialize the state machine with initial state datum:

let initialState = InitialState AssocMap.empty AssocMap.empty
runInitialise client initialState minAdaTxOutValue

After, I'm not able to retrieve that datum from script address, but I can get the DatumHash.

(TxOutRef {txOutRefId = 125691d0f81f6f709ccc4fdbddb2d652d8376fed32e5d0b9c5b1f41dde5b5f9c, txOutRefIdx = 0},ScriptChainIndexTxOut {_ciTxOutAddress = Address {addressCredential = ScriptCredential eeed6b53c965e6a79c19960b7806dcd1bb8dd225c6a72f861189c6ea, addressStakingCredential = Nothing}, _ciTxOutValidator = Left eeed6b53c965e6a79c19960b7806dcd1bb8dd225c6a72f861189c6ea, _ciTxOutDatum = Left 1700176a10586283f36a2a925edcb3e44330b0fb91d6dc6552288c20c96ee375, _ciTxOutValue = Value (Map [(,Map [(\"\",2000000)])])})

@bhoudebert Unfortunately, datumFromHash function from chain-index doesn't help me to retrieve the Datum.
datumFromHash 1700176a10586283f36a2a925edcb3e44330b0fb91d6dc6552288c20c96ee375 returns Nothing. I tried this workflow with simpler data in initial state (string), and had the same result.

@bhoudebert
Copy link

@olgaklimenko good news is a PR is soon to be pushed to main allowing us to move forward!

#167

@silky silky closed this as completed Dec 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants