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

Websocket error with `mustSpendScriptOutput` #386

Closed ngua closed 2 years ago

ngua commented 2 years ago

Currently, using mustSpendScriptOutput as a constraint leads to the following error message:

unexpected parse error on input:
{
  "type": "jsonwsp/fault",
  "version": "1.0",
  "servicename": "ogmios",
  "fault": {
    "code": "client",
    "string": "Invalid request: unknown method in 'methodname' (beware names are case-sensitive)."
  },
  "reflection": null
}
groscoe commented 2 years ago

I noticed that on src/Contract/Monad.purs, line 184, mkContractConfig populates the datumCacheWs with ogmiosConfig, instead of datumCacheConfig.

mkContractConfig
  :: forall (r :: Row Type). ConfigParams r -> Aff (ContractConfig r)
mkContractConfig
  (ConfigParams params@{ slotConfig, logLevel, networkId, wallet }) = do
  ogmiosWs <- QueryM.mkOgmiosWebSocketAff logLevel params.ogmiosConfig
  datumCacheWs <- QueryM.mkDatumCacheWebSocketAff logLevel params.ogmiosConfig
ngua commented 2 years ago

Thanks @groscoe!