packages feed

haskoin-store 0.53.4 → 0.53.5

raw patch · 5 files changed

+35/−7 lines, 5 filesdep ~haskoin-store-dataPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: haskoin-store-data

API changes (from Hackage documentation)

+ Haskoin.Store.Cache: cacheDelXPubs :: (MonadUnliftIO m, MonadLoggerIO m, StoreReadBase m) => [XPubSpec] -> CacheT m Integer

Files

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.53.5+### Addded+- Endpoint to delete an xpub from cache.+ ## 0.53.4 ### Added - Debugging when reverting block.
haskoin-store.cabal view
@@ -1,13 +1,13 @@ cabal-version: 1.12 --- This file has been generated from package.yaml by hpack version 0.33.0.+-- This file has been generated from package.yaml by hpack version 0.34.4. -- -- see: https://github.com/sol/hpack ----- hash: 5335e9cbdcb9bb2776876aaebeb3be20dfb8c6bcb2a98ab0f6fff39e89f897d9+-- hash: a15958b2b429246b2f843fdaeb3b0cf8a602f1c59f52c0008e301628d9e8030c  name:           haskoin-store-version:        0.53.4+version:        0.53.5 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@@ -62,7 +62,7 @@     , hashable >=1.3.0.0     , haskoin-core >=0.20.4     , haskoin-node >=0.17.0-    , haskoin-store-data ==0.53.4+    , haskoin-store-data ==0.53.5     , hedis >=0.12.13     , http-types >=0.12.3     , lens >=4.18.1@@ -116,7 +116,7 @@     , haskoin-core >=0.20.4     , haskoin-node >=0.17.0     , haskoin-store-    , haskoin-store-data ==0.53.4+    , haskoin-store-data ==0.53.5     , hedis >=0.12.13     , http-types >=0.12.3     , lens >=4.18.1@@ -175,7 +175,7 @@     , haskoin-core >=0.20.4     , haskoin-node >=0.17.0     , haskoin-store-    , haskoin-store-data ==0.53.4+    , haskoin-store-data ==0.53.5     , hedis >=0.12.13     , hspec >=2.7.1     , http-types >=0.12.3
src/Haskoin/Store/Cache.hs view
@@ -23,6 +23,7 @@     , CacheWriterInbox     , cacheNewBlock     , cacheWriter+    , cacheDelXPubs     , isInCache     ) where @@ -1197,6 +1198,13 @@ redisSetAddrInfo ::        (Functor f, RedisCtx m f) => Address -> AddressXPub -> m (f ()) redisSetAddrInfo a i = void <$> Redis.set (addrPfx <> encode a) (encode i)++cacheDelXPubs :: (MonadUnliftIO m, MonadLoggerIO m, StoreReadBase m)+              => [XPubSpec]+              -> CacheT m Integer+cacheDelXPubs xpubs = ReaderT $ \case+    Just cache -> runReaderT (delXPubKeys xpubs) cache+    Nothing -> return 0  delXPubKeys ::        (MonadUnliftIO m, MonadLoggerIO m, StoreReadBase m)
src/Haskoin/Store/Logic.hs view
@@ -510,7 +510,7 @@ updateMempool :: MonadImport m => TxData -> m () updateMempool td@TxData{txDataDeleted = True} =     deleteFromMempool (txHash (txData td))-updateMempool td@TxData{txDataDeleted = False, txDataBlock = MemRef t} =+updateMempool td@TxData{txDataBlock = MemRef t} =     addToMempool (txHash (txData td)) t updateMempool td@TxData{txDataBlock = BlockRef{}} =     deleteFromMempool (txHash (txData td))
src/Haskoin/Store/Web.hs view
@@ -210,6 +210,7 @@     , xPubTxStat      :: !StatDist     , xPubTxFullStat  :: !StatDist     , xPubUnspentStat :: !StatDist+    , xPubDel         :: !StatDist     , multiaddrStat   :: !StatDist     , rawaddrStat     :: !StatDist     , balanceStat     :: !StatDist@@ -242,6 +243,7 @@     xPubTxStat        <- d "xpub_tx"     xPubTxFullStat    <- d "xpub_tx_full"     xPubUnspentStat   <- d "xpub_unspent"+    xPubDel           <- d "xpub_delete"     rawaddrStat       <- d "rawaddr"     multiaddrStat     <- d "multiaddr"     balanceStat       <- d "balance"@@ -654,6 +656,11 @@         (fmap SerialList . scottyXPubUnspent)         (\n -> list (xPubUnspentToEncoding n) . getSerialList)         (\n -> json_list xPubUnspentToJSON n . getSerialList)+    pathCompact+        (DelCachedXPub <$> paramLazy <*> paramDef)+        scottyDelXPub+        (const toEncoding)+        (const toJSON)     -- Network     pathCompact         (GetPeers & return)@@ -1207,6 +1214,15 @@     let xspec = XPubSpec xpub deriv     xbals <- xPubBals xspec     lift . runNoCache noCache $ xPubSummary xspec xbals++scottyDelXPub :: (MonadUnliftIO m, MonadLoggerIO m)+              => DelCachedXPub -> WebT m (GenericResult Bool)+scottyDelXPub (DelCachedXPub xpub deriv) = do+    setMetrics xPubDel 1+    let xspec = XPubSpec xpub deriv+    cacheM <- lift (asks (storeCache . webStore . webConfig))+    n <- lift $ withCache cacheM (cacheDelXPubs [xspec])+    return (GenericResult (n > 0))  getXPubTxs :: (MonadUnliftIO m, MonadLoggerIO m)            => XPubKey -> DeriveType -> LimitsParam -> Bool -> WebT m [TxRef]