Plutonomicon / cardano-transaction-lib

A Purescript library for building smart contract transactions on Cardano
https://plutonomicon.github.io/cardano-transaction-lib/
MIT License
93 stars 50 forks source link

Can't get datum from Ogmios Query #257

Closed vvtran closed 2 years ago

vvtran commented 2 years ago

Running npm run dev on viet/seabug-deployment-test-datum-hash. The lookups logic appears to struggle with mustSpendScriptOutput as a result of not being able to successfully query datum from the datumHash via getDatumByHash :: DatumHash -> QueryM (Maybe PlutusData), it's unclear to why it's not working but the following is logged:

sending:  {"type":"jsonwsp/request","version":"1.0","servicename":"ogmios","methodname":"GetDatumByHash","args":{"hash":"961d7ebd383bef116ef9bcb527f1bc1a4587f819d4ec0e723fef5ab228ad1d8f"}}

message:  {"methodname":"GetDatumByHash","result":{"DatumNotFound":null},"servicename":"ogmios-datum-cache","version":"1.0","type":"jsonwsp/response"}

See the MustSpendScriptOutput case of Types.ScriptLookups.processConstraint, a call to getDatumByHash is where it seems to crash. You can test this by logging before and after.

ngua commented 2 years ago

I'm going to close this for now since I've confirmed that ogmios-datum-cache works as expected (tested using curl, but the above error suggests that our WS connection is calling the correct thing) after syncing. If there is another bug with our WS interface to ogmios-datum-cache (e.g. deserialization failure), please re-open this with the specific error