Browse Source

bugfix: use decodeUtf8' instead of decodeUtf8

master
Denis Tereshkin 7 years ago
parent
commit
45e50e12d7
  1. 2
      libatrade.cabal
  2. 6
      src/ATrade/Types.hs

2
libatrade.cabal

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
name: libatrade
version: 0.8.0.0
version: 0.8.0.1
synopsis: ATrade infrastructure core library
description: Please see README.md
homepage: https://github.com/asakul/libatrade.git

6
src/ATrade/Types.hs

@ -231,11 +231,13 @@ parseBar = do @@ -231,11 +231,13 @@ parseBar = do
deserializeBar :: [ByteString] -> Maybe (BarTimeframe, Bar)
deserializeBar (header:rawData:_) = case runGetOrFail parseBar rawData of
Left (_, _, _) -> Nothing
Right (_, _, (tf, bar)) -> Just $ (tf, bar { barSecurity = T.takeWhile (/= ':') . E.decodeUtf8 . B.toStrict $ header })
Right (_, _, (tf, bar)) ->
case E.decodeUtf8' . B.toStrict $ header of
Right fullHeader -> Just $ (tf, bar { barSecurity = T.takeWhile (/= ':') fullHeader })
Left err -> Nothing
deserializeBar _ = Nothing
data SignalId = SignalId {
strategyId :: T.Text,
signalName :: T.Text,

Loading…
Cancel
Save