Lecture #6 Oracle Client issue


I’m going through the Plutus Pioneer Program lectures (iteration #1), and I’m stuck trying to get the oracle-client executable functioning. I’m on the right commit RE: my ~/plutus repository, which I’m running the nix-shell out of, and navigating to the ~/plutus-pioneer-program/code/week06 folder to execute. After getting the oracle-pab running, when I open up a second nix-shell and try to execute oracle-client I get this in the terminal after the oracle contract instance hash:

oracle-client: app/oracle-client.hs:55:9-108: Non-exhaustive patterns in (_, _, _, [bs])

I’m not sure what’s going on, because I’m not familiar with the Servant library and am still in the process of learning JSON and HTTP requests interacting with Haskell. Everything else has been working.

If anybody has any insight, I’d appreciate it, otherwise I’m gonna keep troubleshooting!


It looks like the regular expression that the client is using to parse https://coinmarketcap.com/currencies/cardano/ is not returning what was expected. Line 55 expects exactly one match, but it evidently is finding either zero or more than one. The problem might be intermittent, or it could have to do with a change at coinmarketcap.

P.S. Here is a discussion of using regular expressions in Haskell: Chapter 8. Efficient file processing, regular expressions, and file name matching.