mlabs-haskell / ogmios

❇️ A WebSocket JSON/RPC bridge for Cardano
https://ogmios.dev
Mozilla Public License 2.0
2 stars 3 forks source link

Include datums in query responses #4

Closed ngua closed 2 years ago

ngua commented 2 years ago

Currently, ogmios only returns the datum hash from chain queries (e.g. server/src/Ogmios/Data/Json/Alonzo.hs):

encodeTxOut
    :: Crypto crypto
    => Al.TxOut (AlonzoEra crypto)
    -> Json
encodeTxOut (Al.TxOut addr value datum) = encodeObject
    [ ( "address"
      , Shelley.encodeAddress addr
      )
    , ( "value"
      , Mary.encodeValue value
      )
    , ( "datum"
      , encodeStrictMaybe encodeDataHash datum
      )
    ]

Our purposes require returning the datum value as well. This should be theoretically possible, as the chain index is capable of doing so.

ngua commented 2 years ago

Solved by ogmios-datum-cache