File tree 1 file changed +6
-2
lines changed
hydra-cardano-api/src/Hydra/Cardano/Api
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 1
1
-- | Shamelessly stolen from cardan-api 'Cardano.Api.SerialiseUsing' module.
2
2
--
3
3
-- With some minor modifications of also using encodeUtf8 in 'IsString' instance.
4
+ --
5
+ -- XXX: Expose / contribute upstream
4
6
module Hydra.Cardano.Api.UsingRawBytesHex where
5
7
6
8
import Hydra.Cardano.Api.Prelude
@@ -52,8 +54,10 @@ deserialiseFromRawBytesBase16 ::
52
54
deserialiseFromRawBytesBase16 str =
53
55
case Base16. decode str of
54
56
Right raw -> case deserialiseFromRawBytes ttoken raw of
55
- Just x -> Right (UsingRawBytesHex x)
56
- Nothing -> Left (" cannot deserialise " ++ show str)
57
+ Right x -> Right (UsingRawBytesHex x)
58
+ -- XXX: cannot user inner value because SerialiseAsRawBytesError data
59
+ -- constructor not exposed
60
+ Left e -> Left (" cannot deserialise " ++ show str ++ " . The error was: " <> show e)
57
61
Left msg -> Left (" invalid hex " ++ show str ++ " , " ++ msg)
58
62
where
59
63
ttoken = proxyToAsType (Proxy :: Proxy a )
You can’t perform that action at this time.
0 commit comments