Skip to content

Commit

Permalink
Value.hs: remove useless usage of ViewPatterns
Browse files Browse the repository at this point in the history
  • Loading branch information
smelc committed Jan 16, 2025
1 parent 52d881e commit 756db56
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cardano-api/internal/Cardano/Api/Value.hs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE ViewPatterns #-}

-- | Currency values
module Cardano.Api.Value
Expand Down Expand Up @@ -387,13 +386,15 @@ instance FromJSON ValueNestedRep where
where
parsePid :: (Aeson.Key, Aeson.Value) -> Parser ValueNestedBundle
parsePid ("lovelace", q) = ValueNestedBundleAda <$> parseJSON q
parsePid (Aeson.toText -> pid, quantityBundleJson) = do
parsePid (key, quantityBundleJson) = do
sHash <-
failEitherWith
(\e -> "Failure when deserialising PolicyId: " ++ displayError e)
$ deserialiseFromRawBytesHex AsScriptHash
$ Text.encodeUtf8 pid
ValueNestedBundle (PolicyId sHash) <$> parseJSON quantityBundleJson
where
pid = Aeson.toText key

-- ----------------------------------------------------------------------------
-- Printing and pretty-printing
Expand Down

0 comments on commit 756db56

Please sign in to comment.