File tree 1 file changed +3
-2
lines changed
cardano-api/internal/Cardano/Api
1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 5
5
{-# LANGUAGE OverloadedStrings #-}
6
6
{-# LANGUAGE ScopedTypeVariables #-}
7
7
{-# LANGUAGE TypeFamilies #-}
8
- {-# LANGUAGE ViewPatterns #-}
9
8
10
9
-- | Currency values
11
10
module Cardano.Api.Value
@@ -387,13 +386,15 @@ instance FromJSON ValueNestedRep where
387
386
where
388
387
parsePid :: (Aeson. Key , Aeson. Value ) -> Parser ValueNestedBundle
389
388
parsePid (" lovelace" , q) = ValueNestedBundleAda <$> parseJSON q
390
- parsePid (Aeson. toText -> pid , quantityBundleJson) = do
389
+ parsePid (key , quantityBundleJson) = do
391
390
sHash <-
392
391
failEitherWith
393
392
(\ e -> " Failure when deserialising PolicyId: " ++ displayError e)
394
393
$ deserialiseFromRawBytesHex AsScriptHash
395
394
$ Text. encodeUtf8 pid
396
395
ValueNestedBundle (PolicyId sHash) <$> parseJSON quantityBundleJson
396
+ where
397
+ pid = Aeson. toText key
397
398
398
399
-- ----------------------------------------------------------------------------
399
400
-- Printing and pretty-printing
You can’t perform that action at this time.
0 commit comments