Remove To/From JSON (Maybe PoolMetadata)#71
Conversation
|
Interesting! Almost looks like a compiler or Do you mind trying to change I wish there was a mechanism to control the instance propagation.. |
|
@sorki thanks for looking at this but unfortunately using both |
|
@sorki @v0d1ch I just tried to verify this too. Using your branch and this diff: diff --git a/cabal.project b/cabal.project
index 6245e60982..7c3e826f2f 100644
--- a/cabal.project
+++ b/cabal.project
@@ -17,9 +17,9 @@ index-state:
source-repository-package
type: git
- location: https://github.com/cardano-scaling/blockfrost-haskell.git
- tag: 042179583f439d09c271b11bac9e9289133c0a66
- --sha256: j2kRxDxtehHB0mQ4lHE6PqjOVca2dHgQgJaxtCPDeM8=
+ location: https://github.com/blockfrost/blockfrost-haskell.git
+ tag: cc7ee38aeb63ea01e9198edee62ea669e6c406da
+ --sha256: 1YCtviZL9/X62OVpqM3AFZDM1wboocupQ7pUFvnCD+I=
subdir:
blockfrost-client-core
blockfrost-api
diff --git a/hydra-node/src/Hydra/API/ServerOutput.hs b/hydra-node/src/Hydra/API/ServerOutput.hs
index 3015e2ce42..c20405a541 100644
--- a/hydra-node/src/Hydra/API/ServerOutput.hs
+++ b/hydra-node/src/Hydra/API/ServerOutput.hs
@@ -106,7 +106,7 @@ data Greetings tx = Greetings
deriving instance IsChainState tx => Eq (Greetings tx)
deriving instance IsChainState tx => Show (Greetings tx)
-instance IsChainState tx => ToJSON (Greetings tx) where
+instance {-# OVERLAPPABLE #-} IsChainState tx => ToJSON (Greetings tx) where
toJSON =
genericToJSON
defaultOptionsI still get this (and more similar errors): |
|
Thanks! I mean My theory is that by using If not I'll remove the instance and find another solution. |
|
Thanks @sorki Interestingly, the error is different: |
I started a fix using a dedicated type for the pool metadata response to avoid instances on Maybe altogether. I'll clean it up and send a PR tomorrow |
|
Fixed via #72 |
Credit @v0d1ch
We had problems compiling
ToJSONinstances with thisToJSON (Maybe PoolMetadata)in scope. As we neither control the instance fromaeson, nor the one in your package, we cannot make instances like this one to compile.FYI compilation errors coming from this:
We found that it is important what modules are compiled in one invocation of
cabal build. For example the above error does not appear if we try another build ofcabal buildwhich had the module pulling in your instance already compiled (Hydra.Chain.Blockfrost.Client).