packages feed

haskoin-store-data 0.47.4 → 0.48.0

raw patch · 4 files changed

+25/−3 lines, 4 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ Haskoin.Store.Data: ServerTimeout :: Except

Files

CHANGELOG.md view
@@ -4,6 +4,19 @@ 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.48.0+### Added+- Timeouts and token bucket for web requests.+- Configurable price fetch interval.++## 0.47.6+### Fixed+- Fix web.all stat.++## 0.47.5+### Changed+- Simplify stats.+ ## 0.47.4 ### Added - Implement Blockchain.info block height.
haskoin-store-data.cabal view
@@ -4,10 +4,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: 5039966812a0dc31f6bda5c8df1b6ab6acb0ff857df800d52af52c4a60281691+-- hash: 896ebdbda04fb65df2964dd33673cfe915511822e73e13d35ed460f5a3619ad7  name:           haskoin-store-data-version:        0.47.4+version:        0.48.0 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
@@ -2101,6 +2101,7 @@     | UserError !String     | StringError !String     | TxIndexConflict ![TxHash]+    | ServerTimeout     deriving (Show, Eq, Ord, Generic, NFData)  instance Serial Except where@@ -2119,6 +2120,8 @@     serialize (TxIndexConflict ts) = do         putWord8 0x05         putList serialize ts+    serialize ServerTimeout = do+        putWord8 0x06      deserialize =         getWord8 >>= \case@@ -2128,6 +2131,7 @@         0x03 -> UserError . T.unpack . TE.decodeUtf8 <$> getLengthBytes         0x04 -> StringError . T.unpack . TE.decodeUtf8 <$> getLengthBytes         0x05 -> TxIndexConflict <$> getList deserialize+        0x06 -> return ServerTimeout         _    -> fail "Cannot recognize exception"  instance Serialize Except where@@ -2168,6 +2172,9 @@                 [ "error" .= String "multiple-tx-index"                 , "message" .= String "Many txs match that tx_index"                 , "txids" .= txids ]+            ServerTimeout ->+                [ "error" .= String "server-timeout"+                , "message" .= String "Request is taking too long" ]  instance FromJSON Except where     parseJSON =@@ -2188,6 +2195,8 @@                 String "multiple-tx-index" -> do                     txids <- o .: "txids"                     return $ TxIndexConflict txids+                String "server-timeout" ->+                    return ServerTimeout                 _ -> mzero  toIntTxId :: TxHash -> Word64@@ -2199,7 +2208,6 @@ --------------------------------------- -- Blockchain.info API Compatibility -- ----------------------------------------  data BinfoBlockId     = BinfoBlockHash !BlockHash
test/Haskoin/Store/DataSpec.hs view
@@ -395,6 +395,7 @@         , UserError <$> arbitrary         , StringError <$> arbitrary         , TxIndexConflict <$> listOf1 arbitraryTxHash+        , return ServerTimeout         ]  ---------------------------------------