haskoin-store-data 0.47.1 → 0.47.2
raw patch · 3 files changed
+35/−31 lines, 3 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Haskoin.Store.Data: BlockHealth :: !BlockHeight -> !BlockHeight -> !Int -> BlockHealth
+ Haskoin.Store.Data: BlockHealth :: !BlockHeight -> !BlockHeight -> !Int32 -> BlockHealth
- Haskoin.Store.Data: CountHealth :: !Int -> !Int -> CountHealth
+ Haskoin.Store.Data: CountHealth :: !Int64 -> !Int64 -> CountHealth
- Haskoin.Store.Data: MaxHealth :: !Int -> !Int -> MaxHealth
+ Haskoin.Store.Data: MaxHealth :: !Int64 -> !Int64 -> MaxHealth
- Haskoin.Store.Data: TimeHealth :: !Int -> !Int -> TimeHealth
+ Haskoin.Store.Data: TimeHealth :: !Int64 -> !Int64 -> TimeHealth
- Haskoin.Store.Data: [blockHealthMaxDiff] :: BlockHealth -> !Int
+ Haskoin.Store.Data: [blockHealthMaxDiff] :: BlockHealth -> !Int32
- Haskoin.Store.Data: [countHealthMin] :: CountHealth -> !Int
+ Haskoin.Store.Data: [countHealthMin] :: CountHealth -> !Int64
- Haskoin.Store.Data: [countHealthNum] :: CountHealth -> !Int
+ Haskoin.Store.Data: [countHealthNum] :: CountHealth -> !Int64
- Haskoin.Store.Data: [maxHealthMax] :: MaxHealth -> !Int
+ Haskoin.Store.Data: [maxHealthMax] :: MaxHealth -> !Int64
- Haskoin.Store.Data: [maxHealthNum] :: MaxHealth -> !Int
+ Haskoin.Store.Data: [maxHealthNum] :: MaxHealth -> !Int64
- Haskoin.Store.Data: [timeHealthAge] :: TimeHealth -> !Int
+ Haskoin.Store.Data: [timeHealthAge] :: TimeHealth -> !Int64
- Haskoin.Store.Data: [timeHealthMax] :: TimeHealth -> !Int
+ Haskoin.Store.Data: [timeHealthMax] :: TimeHealth -> !Int64
Files
- CHANGELOG.md +4/−0
- haskoin-store-data.cabal +2/−2
- src/Haskoin/Store/Data.hs +29/−29
CHANGELOG.md view
@@ -4,6 +4,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html) +## 0.47.2+### Fixed+- Fix serialization bug for health check.+ ## 0.47.1 ### Fixed - Fix serialization bugs for web data types.
haskoin-store-data.cabal view
@@ -4,10 +4,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: eee57844ddf308325bf17f93eb3f4c839c3b3f45c37030619e4d592e98ed5349+-- hash: 26bfc2d99799fc52417601d4b2fa0ce25a5981df63ad79236d8567dba16d80cb name: haskoin-store-data-version: 0.47.1+version: 0.47.2 synopsis: Data for Haskoin Store description: Please see the README on GitHub at <https://github.com/haskoin/haskoin-store#readme> category: Bitcoin, Finance, Network
src/Haskoin/Store/Data.hs view
@@ -1598,21 +1598,21 @@ BlockHealth { blockHealthHeaders :: !BlockHeight , blockHealthBlocks :: !BlockHeight- , blockHealthMaxDiff :: !Int+ , blockHealthMaxDiff :: !Int32 } deriving (Show, Eq, Generic, NFData) instance Serial BlockHealth where serialize h@BlockHealth{..} = do serialize (isOK h)- serialize blockHealthHeaders- serialize blockHealthBlocks- serialize blockHealthMaxDiff+ putWord32be blockHealthHeaders+ putWord32be blockHealthBlocks+ putInt32be blockHealthMaxDiff deserialize = do k <- deserialize- blockHealthHeaders <- deserialize- blockHealthBlocks <- deserialize- blockHealthMaxDiff <- deserialize+ blockHealthHeaders <- getWord32be+ blockHealthBlocks <- getWord32be+ blockHealthMaxDiff <- getInt32be let h = BlockHealth{..} unless (k == isOK h) $ fail "Inconsistent health check" return h@@ -1654,20 +1654,20 @@ data TimeHealth = TimeHealth- { timeHealthAge :: !Int- , timeHealthMax :: !Int+ { timeHealthAge :: !Int64+ , timeHealthMax :: !Int64 } deriving (Show, Eq, Generic, NFData) instance Serial TimeHealth where serialize h@TimeHealth{..} = do serialize (isOK h)- serialize timeHealthAge- serialize timeHealthMax+ putInt64be timeHealthAge+ putInt64be timeHealthMax deserialize = do k <- deserialize- timeHealthAge <- deserialize- timeHealthMax <- deserialize+ timeHealthAge <- getInt64be+ timeHealthMax <- getInt64be let t = TimeHealth{..} unless (k == isOK t) $ fail "Inconsistent health check" return t@@ -1701,20 +1701,20 @@ data CountHealth = CountHealth- { countHealthNum :: !Int- , countHealthMin :: !Int+ { countHealthNum :: !Int64+ , countHealthMin :: !Int64 } deriving (Show, Eq, Generic, NFData) instance Serial CountHealth where serialize h@CountHealth{..} = do serialize (isOK h)- serialize countHealthNum- serialize countHealthMin+ putInt64be countHealthNum+ putInt64be countHealthMin deserialize = do k <- deserialize- countHealthNum <- deserialize- countHealthMin <- deserialize+ countHealthNum <- getInt64be+ countHealthMin <- getInt64be let c = CountHealth{..} unless (k == isOK c) $ fail "Inconsistent health check" return c@@ -1748,20 +1748,20 @@ data MaxHealth = MaxHealth- { maxHealthNum :: !Int- , maxHealthMax :: !Int+ { maxHealthNum :: !Int64+ , maxHealthMax :: !Int64 } deriving (Show, Eq, Generic, NFData) instance Serial MaxHealth where serialize h@MaxHealth {..} = do serialize $ isOK h- serialize maxHealthNum- serialize maxHealthMax+ putInt64be maxHealthNum+ putInt64be maxHealthMax deserialize = do k <- deserialize- maxHealthNum <- deserialize- maxHealthMax <- deserialize+ maxHealthNum <- getInt64be+ maxHealthMax <- getInt64be let h = MaxHealth{..} unless (k == isOK h) $ fail "Inconsistent health check" return h@@ -1812,8 +1812,8 @@ serialize healthLastTx serialize healthPendingTxs serialize healthPeers- serialize healthNetwork- serialize healthVersion+ putLengthBytes ((TE.encodeUtf8 . T.pack) healthNetwork)+ putLengthBytes ((TE.encodeUtf8 . T.pack) healthVersion) deserialize = do k <- deserialize healthBlocks <- deserialize@@ -1821,8 +1821,8 @@ healthLastTx <- deserialize healthPendingTxs <- deserialize healthPeers <- deserialize- healthNetwork <- deserialize- healthVersion <- deserialize+ healthNetwork <- T.unpack . TE.decodeUtf8 <$> getLengthBytes+ healthVersion <- T.unpack . TE.decodeUtf8 <$> getLengthBytes let h = HealthCheck {..} unless (k == isOK h) $ fail "Inconsistent health check" return h