Skip to content

Commit

Permalink
ApiScript correct
Browse files Browse the repository at this point in the history
stack.yaml

stack.yaml
  • Loading branch information
paweljakubas committed Oct 23, 2020
1 parent a3ed826 commit d12b94c
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 648 deletions.
7 changes: 5 additions & 2 deletions lib/core/src/Cardano/Wallet/Api/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1261,9 +1261,12 @@ instance ToJSON (ApiT (Passphrase purpose)) where
toJSON = toJSON . toText . getApiT

instance FromJSON ApiScript where
parseJSON = fmap (ApiScript . ApiT) . parseJSON
parseJSON = withObject "Script" $ \o -> do
script' <- o .: "script"
fmap (ApiScript . ApiT) $ parseJSON script'
instance ToJSON ApiScript where
toJSON (ApiScript (ApiT script')) = toJSON script'
toJSON (ApiScript (ApiT script')) =
object ["script" .= toJSON script']

instance MkSomeMnemonic sizes => FromJSON (ApiMnemonicT sizes)
where
Expand Down
Loading

0 comments on commit d12b94c

Please sign in to comment.