haskoin-store 0.44.0 → 0.45.0
raw patch · 3 files changed
+8/−19 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
- Haskoin.Store.Web: [webNumTxId] :: WebConfig -> !Bool
+ Haskoin.Store.Web: TxIndexConflict :: ![TxHash] -> Except
- Haskoin.Store: getNumTxData :: StoreReadExtra m => Word64 -> m (Maybe TxData)
+ Haskoin.Store: getNumTxData :: StoreReadExtra m => Word64 -> m [TxData]
- Haskoin.Store.Common: getNumTransaction :: (Monad m, StoreReadExtra m) => Word64 -> m (Maybe Transaction)
+ Haskoin.Store.Common: getNumTransaction :: (Monad m, StoreReadExtra m) => Word64 -> m [Transaction]
- Haskoin.Store.Common: getNumTxData :: StoreReadExtra m => Word64 -> m (Maybe TxData)
+ Haskoin.Store.Common: getNumTxData :: StoreReadExtra m => Word64 -> m [TxData]
- Haskoin.Store.Web: WebConfig :: !String -> !Int -> !Store -> !Int -> !Int -> !WebLimits -> !WebTimeouts -> !String -> !Bool -> !Bool -> !Maybe Store -> WebConfig
+ Haskoin.Store.Web: WebConfig :: !String -> !Int -> !Store -> !Int -> !Int -> !WebLimits -> !WebTimeouts -> !String -> !Bool -> !Maybe Store -> WebConfig
Files
- app/Main.hs +0/−13
- haskoin-store.cabal +2/−2
- src/Haskoin/Store/Web.hs +6/−4
app/Main.hs view
@@ -75,7 +75,6 @@ , configMaxDiff :: !Int , configCacheRefresh :: !Int , configCacheRetryDelay :: !Int- , configNumTxId :: !Bool , configStatsd :: !Bool , configStatsdHost :: !String , configStatsdPort :: !Int@@ -107,7 +106,6 @@ , configMaxDiff = defMaxDiff , configCacheRefresh = defCacheRefresh , configCacheRetryDelay = defCacheRetryDelay- , configNumTxId = defNumTxId , configStatsd = defStatsd , configStatsdHost = defStatsdHost , configStatsdPort = defStatsdPort@@ -190,11 +188,6 @@ defEnv "DEBUG" False parseBool {-# NOINLINE defDebug #-} -defNumTxId :: Bool-defNumTxId = unsafePerformIO $- defEnv "NUMTXID" False parseBool-{-# NOINLINE defNumTxId #-}- defWebLimits :: WebLimits defWebLimits = unsafePerformIO $ do max_limit <- defEnv "MAX_LIMIT" (maxLimitCount def) readMaybe@@ -497,10 +490,6 @@ <> help "Maximum difference between headers and blocks" <> showDefault <> value (configMaxDiff def)- configNumTxId <-- flag (configNumTxId def) True $- long "numtxid"- <> help "Numeric tx_index field" configStatsd <- flag (configStatsd def) True $ long "statsd"@@ -598,7 +587,6 @@ , configNoMempool = nomem , configCacheRefresh = crefresh , configCacheRetryDelay = cretrydelay- , configNumTxId = numtxid , configStatsd = statsd , configStatsdHost = statsdhost , configStatsdPort = statsdport@@ -645,7 +633,6 @@ , webVersion = version , webMaxDiff = maxdiff , webNoMempool = nomem- , webNumTxId = numtxid , webStats = stats } where
haskoin-store.cabal view
@@ -4,10 +4,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: b5a848bca1fcc3e0b0c69c2b9e0b04b81a35c40cf454e1e03fd93e3aa3679d6a+-- hash: 32e77f6ea3e02f74893229c350cdad3e1ebfeac9fa713efa9c32cce8c0f9102c name: haskoin-store-version: 0.44.0+version: 0.45.0 synopsis: Storage and index for Bitcoin and Bitcoin Cash description: Please see the README on GitHub at <https://github.com/haskoin/haskoin-store#readme> category: Bitcoin, Finance, Network
src/Haskoin/Store/Web.hs view
@@ -145,7 +145,6 @@ , webTimeouts :: !WebTimeouts , webVersion :: !String , webNoMempool :: !Bool- , webNumTxId :: !Bool , webStats :: !(Maybe Metrics.Store) } @@ -1238,9 +1237,13 @@ xpub (BinfoXpub x) = Just x xpub (BinfoAddr _) = Nothing +getNumTxId :: MonadIO m => WebT m Bool+getNumTxId = fmap not $ S.param "txidindex" `S.rescue` const (return False)+ scottyBinfoUnspent :: (MonadUnliftIO m, MonadLoggerIO m) => WebT m () scottyBinfoUnspent = getBinfoActive unspentErrors >>= \(xspecs, addrs) ->+ getNumTxId >>= \numtxid -> get_limit >>= \limit -> get_min_conf >>= \min_conf -> let len = HashSet.size addrs + HashMap.size xspecs@@ -1248,7 +1251,6 @@ xuns <- get_xpub_unspents xspecs auns <- get_addr_unspents addrs net <- lift $ asks (storeNetwork . webStore . webConfig)- numtxid <- lift $ asks (webNumTxId . webConfig) height <- get_height let g k = map (xpub_unspent numtxid height k) xbus = concatMap (uncurry g) (HashMap.toList xuns)@@ -1302,6 +1304,7 @@ scottyMultiAddr :: (MonadUnliftIO m, MonadLoggerIO m) => WebT m () scottyMultiAddr = get_addrs >>= \(addrs, xpubs, saddrs, sxpubs, xspecs) ->+ getNumTxId >>= \numtxid -> lift (asks webTicker) >>= \ticker -> get_price ticker >>= \local -> get_cashaddr >>= \cashaddr ->@@ -1310,7 +1313,6 @@ get_prune >>= \prune -> let len = HashSet.size addrs + HashSet.size xpubs in withMetrics multiaddrResponseTime len $ do- numtxid <- lift $ asks (webNumTxId . webConfig) xbals <- get_xbals xspecs let sxbals = subset sxpubs xbals xtrs <- get_xtrs xspecs@@ -1518,7 +1520,7 @@ scottyBinfoTx :: (MonadUnliftIO m, MonadLoggerIO m) => WebT m () scottyBinfoTx =- lift (asks (webNumTxId . webConfig)) >>= \numtxid ->+ getNumTxId >>= \numtxid -> S.param "txid" >>= \txid -> withMetrics rawtxResponseTime 1 $ go numtxid txid where